Documentation ¶
Overview ¶
Package errors implements utilities to handle errors in koazee
Index ¶
- type ErrCode
- type Error
- func EmptyStream(op string, msg string, args ...interface{}) *Error
- func InvalidArgument(op string, msg string, args ...interface{}) *Error
- func InvalidIndex(op string, msg string, args ...interface{}) *Error
- func InvalidType(op string, msg string, args ...interface{}) *Error
- func New(operation string, code ErrCode, msgFormat string, args ...interface{}) *Error
- func UserError(op string, err error) *Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrCode ¶
type ErrCode string
ErrCode type used to define the error codes in koazee
const ErrInvalidArgument ErrCode = "err.invalid-argument"
ErrInvalidArgument code for errors produced by an invalid input in the operation
const ErrInvalidIndex ErrCode = "err.invalid-index"
ErrInvalidIndex code for errors related to invalid index when accessing to a position in the stream
const ErrInvalidType ErrCode = "err.invalid-type"
ErrInvalidType code for errors related to invalid type
const ErrItemsNil ErrCode = "err.items-nil"
ErrItemsNil code for errors produced by a nil stream
const ErrUser ErrCode = "err.user-error"
ErrUser code for errors produced by the user's function
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error encapsulates error info
func EmptyStream ¶
EmptyStream creates an item nil error
func InvalidArgument ¶
InvalidArgument creates a invalid argument error
func InvalidIndex ¶
InvalidIndex creates a invalid index error
func InvalidType ¶
InvalidType creates an invalid type error