{"modulePath":"github.com/nuclio/errors","version":"v0.0.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\nPackage errors provides an api similar to github.com/nuclio/nuclio/pkg/errors However we don't carry stack trace around for performance (see [https://github.com/pkg/errors/issues/124](https://github.com/pkg/errors/issues/124))\n\n## Variables\n\n```go\nvar (\n\t// ShowLineInfo sets if we collect location information (file, line)\n\t// (getting location information makes creating error slower ~550ns vs 2ns)\n\tShowLineInfo bool\n)\n```\n\n## Functions\n\n```go\nfunc Cause(err error) error\n```\nCause is the cause of the error\n\n```go\nfunc Errorf(format string, args ...interface{}) error\n```\nErrorf returns a new Error\n\n```go\nfunc GetErrorStack(err error, depth int) []error\n```\nGetErrorStack return stack of messges (oldest on top) if n == -1 returns the whole stack\n\n```go\nfunc GetErrorStackString(err error, depth int) string\n```\nGetErrorStackString returns the error stack as a string\n\n```go\nfunc Is(base, target error) bool\n```\n\n```go\nfunc New(message string) error\n```\nNew returns a new error\n\n```go\nfunc PrintErrorStack(out io.Writer, err error, depth int)\n```\nPrintErrorStack prints the error stack into out up to depth levels If n == 1 then prints the whole stack\n\n```go\nfunc RootCause(err error) error\n```\nRootCause is the cause of the error\n\n```go\nfunc Wrap(err error, message string) error\n```\nWrap returns a new error with err as cause, if err is nil will return nil\n\n```go\nfunc Wrapf(err error, format string, args ...interface{}) error\n```\nWrapf returns a new error with err as cause, if err is nil will return nil\n\n## Types\n\n```go\ntype Error struct {\n\t// contains filtered or unexported fields\n}\n```\nError implements error interface with call stack\n\n```go\nfunc (err *Error) Cause() error\n```\nCause returns the cause of the error\n\n```go\nfunc (err *Error) Error() string\n```\nError is the string representation of the error\n\n```go\nfunc (err *Error) Format(s fmt.State, verb rune)\n```\nFormat formats an error\n\n```go\nfunc (err *Error) LineInfo() (string, int)\n```\nLineInfo info returns the location (file, line) where the error was created\n\n```go\nfunc (err *Error) Unwrap() error\n```\n\n","path":"github.com/nuclio/errors","name":"errors","synopsis":"Package errors provides an api similar to github.com/nuclio/nuclio/pkg/errors However we don't carry stack trace around for performance (see https://github.com/pkg/errors/issues/124)","isRedistributable":true}
