Errors and Exceptions
Built in Error Types
record ErrorCode(string Value);
record Error(ErrorCode ErrorCode, string Message);ErrorCode
Static Error Codes (recommended)
public static class ErrorCodes
{
public static readonly ErrorCode InputMissing = new("input.missing");
public static readonly ErrorCode InputMalformed = new("input.malformed");
public static readonly ErrorCode InputOutOfRange = new("input.out_of_range");
}Error Code from Enum
Error Code from Exception
Error
Error from Exception
Custom Exceptions
UnwrapException
UnmetExpectationException
Last updated
Was this helpful?