Documentation
¶
Index ¶
- Constants
- func AppendError(err, errn error) error
- func GetErrs(err error) []error
- func GetHTTPDetails(err error) (code int, msg string)
- func IsOfType(terr, err error) bool
- func Len(err error) int
- func New(format string, args ...interface{}) error
- func NewHTTPError(c int, err error) error
- func NewTypedError(terr, err error) error
- type Error
- type TypedError
Constants ¶
const ErrUnknown = Error("unknown error")
ErrUnknown is an unknown error type
Variables ¶
This section is empty.
Functions ¶
func AppendError ¶
AppendError returns a new listError if errn == nil, return err if err is of type listError and if errn is of type listerror, append errn errors to err and return err
func GetHTTPDetails ¶
GetHTTPDetails returns a http code and message default http code is 500.
func Len ¶
Len returns the total number of errors if err is listError, return len(listError.errs) if err == nil, return 0 else return 1
func New ¶
New returns a new error with message passed. if args are passed, we will format the message with args Example: New("some error") returns error with exact string passed New("some error: %v", "some context") returns error with message "some error: some context"
func NewTypedError ¶
NewTypedError returns a new error of type typedError
Types ¶
type Error ¶
type Error string
Error is a string that implements error this will have interesting side effects of having constant errors
type TypedError ¶
TypedError can be implemented by any type error