{"modulePath":"github.com/infinitbyte/framework","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\nmultierror is a simple Go package for combining multiple errors together.\n\n## Functions\n\n```go\nfunc Cause(err error) error\n```\nCause returns the underlying cause of the error, if possible. An error value has a cause if it implements the following interface:\n\n\ttype Causer interface {\n\t       Cause() error\n\t}\n\nIf the error does not implement Cause, the original error will be returned. If the error is nil, nil will be returned without further investigation.\n\n```go\nfunc Error(args ...interface{}) error\n```\n\n```go\nfunc Errorf(format string, args ...interface{}) error\n```\nErrorf formats according to a format specifier and returns the string as a value that satisfies error.\n\n```go\nfunc New(message string) error\n```\nNew returns an error with the supplied message.\n\n```go\nfunc NewWithCode(err error, code ErrorCode, msg string) error\n```\nNewWithCode create a error with error code and message\n\n```go\nfunc NewWithPayload(err error, code ErrorCode, payload interface{}, msg string) error\n```\nNewWithPayload create error with error code and payload and message\n\n```go\nfunc Wrap(err error, message string) error\n```\nWrap returns an error annotating err with message. If err is nil, Wrap returns nil.\n\n```go\nfunc Wrapf(err error, format string, args ...interface{}) error\n```\nWrapf returns an error annotating err with the format specifier. If err is nil, Wrapf returns nil.\n\n## Types\n\n```go\ntype ErrorCode int\n```\nErrorCode is enum object of errors\n\n```go\nvar (\n\t// Default unknow error\n\tDefault          ErrorCode = 1\n\tInvalidParameter ErrorCode = 2\n\t// JSONIsEmpty error when json is empty\n\tJSONIsEmpty ErrorCode = 100\n\t// BodyEmpty error when body is empty\n\tBodyEmpty ErrorCode = 101\n\t// URLRedirected error when url redirected\n\tURLRedirected ErrorCode = 102\n)\n```\n\n```go\nfunc Code(err error) ErrorCode\n```\nCode return error code\n\n```go\nfunc CodeWithPayload(err error) (ErrorCode, interface{})\n```\nCodeWithPayload return error code and payload\n\n```go\ntype ErrorPayload interface{}\n```\nErrorPayload is detail payload of errors\n\n```go\ntype Errors []error\n```\nThe Errors type wraps a slice of errors\n\n```go\nfunc (e Errors) Err() error\n```\nReturns a MultiError struct containing this Errors instance, or nil if there are zero errors contained.\n\n```go\ntype Frame uintptr\n```\nFrame represents a program counter inside a stack frame.\n\n```go\nfunc (f Frame) Format(s fmt.State, verb rune)\n```\nFormat formats the frame according to the fmt.Formatter interface.\n\n\t%s    source file\n\t%d    source line\n\t%n    function name\n\t%v    equivalent to %s:%d\n\nFormat accepts flags that alter the printing of some verbs, as follows:\n\n\t%+s   path of source file relative to the compile time GOPATH\n\t%+v   equivalent to %+s:%d\n\n```go\ntype MultiError struct {\n\tErrors Errors\n}\n```\nThe MultiError type implements the error interface, and contains the Errors used to construct it.\n\n```go\nfunc (m *MultiError) Error() string\n```\nReturns a concatenated string of the contained errors\n\n```go\ntype StackTrace []Frame\n```\nStackTrace is stack of Frames from innermost (newest) to outermost (oldest).\n\n```go\nfunc (st StackTrace) Format(s fmt.State, verb rune)\n```\nFormat format stack trace\n\n","path":"github.com/infinitbyte/framework/core/errors","name":"errors","synopsis":"multierror is a simple Go package for combining multiple errors together.","isRedistributable":true}
