Documentation ¶
Index ¶
- Variables
- func Cis(code *ErrorCode, e R) bool
- func Equals(e, r R) bool
- func FuzzyEquals(e, r R) bool
- func IsLoopBreak(e R) bool
- func Native(err R) error
- func Wrapped(err R) error
- type ErrorCode
- type ErrorType
- func (e *ErrorType) Code(info string) *ErrorCode
- func (e *ErrorType) CodeWithDefault(info string, defaultError error) *ErrorCode
- func (e *ErrorType) CodeWithDetail(info string, detail string) *ErrorCode
- func (e *ErrorType) CodeWithNumber(info string, number int) *ErrorCode
- func (e *ErrorType) CodeWithNumberAndDetail(info string, number int, detail string) *ErrorCode
- func (e *ErrorType) Decode(err R) *ErrorCode
- func (e *ErrorType) Is(err R) bool
- func (e *ErrorType) NumberToCode(number int) *ErrorCode
- type R
Constants ¶
This section is empty.
Variables ¶
View Source
var EOF = GenericErrorType.CodeWithDefault("EOF", io.EOF)
View Source
var ErrUnexpectedEOF = GenericErrorType.CodeWithDefault("ErrUnexpectedEOF", io.ErrUnexpectedEOF)
View Source
var GenericErrorType = NewErrorType("er.GenericErrorType")
GenericErrorType is for packages with only one or two error codes which don't make sense having their own error type
View Source
var LoopBreak = E(errrLoopbreak)
A (non) error which is used to break out of a forEach loop
Functions ¶
func FuzzyEquals ¶
func IsLoopBreak ¶
Types ¶
type ErrorCode ¶
type ErrorCode struct { Detail string Number int Type *ErrorType // contains filtered or unexported fields }
ErrorCode is a code for identifying a particular type of fault. Error codes can have a numeric code identifier or they can not.
type ErrorType ¶
ErrorType is a generic type of error, each type can have many error codes
func NewErrorType ¶
NewErrorType creates a new error type, it must be identified by name. For example: var MyError er.ErrorType = NewErrorType("mypackage.MyError")
func (*ErrorType) CodeWithDefault ¶
func (*ErrorType) CodeWithDetail ¶
func (*ErrorType) CodeWithNumber ¶
func (*ErrorType) CodeWithNumberAndDetail ¶
func (*ErrorType) NumberToCode ¶
Click to show internal directories.
Click to hide internal directories.