Wrapper enum used for safe error handling.

function getContent(filename : String) : Result<String, String> {
	 if (!sys.FileSystem.exists(file)) return Error('file $file does not exist');
	 else return Ok(sys.io.File.getContent(file));
}

Values

Ok(t:T)

represents as sucessful operation, with the desired value.

Error(e:E)

represents a failed operation, with detailed error information.