{"modulePath":"github.com/codefresh-io/argo-workflows","version":"v2.5.2+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Constants\n\n```go\nconst (\n\tCodeUnauthorized   = \"ERR_UNAUTHORIZED\"\n\tCodeBadRequest     = \"ERR_BAD_REQUEST\"\n\tCodeForbidden      = \"ERR_FORBIDDEN\"\n\tCodeNotFound       = \"ERR_NOT_FOUND\"\n\tCodeNotImplemented = \"ERR_NOT_IMPLEMENTED\"\n\tCodeTimeout        = \"ERR_TIMEOUT\"\n\tCodeInternal       = \"ERR_INTERNAL\"\n)\n```\nExternally visible error codes\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 Errorf(code string, format string, args ...interface{}) error\n```\nErrorf returns an error and formats according to a format specifier\n\n```go\nfunc InternalError(message string) error\n```\nInternalError is a convenience function to create a Internal error with a message\n\n```go\nfunc InternalErrorf(format string, args ...interface{}) error\n```\nInternalErrorf is a convenience function to format an Internal error\n\n```go\nfunc InternalWrapError(err error, message ...string) error\n```\nInternalWrapError annotates the error with the ERR\\_INTERNAL code and a stack trace, optional message\n\n```go\nfunc InternalWrapErrorf(err error, format string, args ...interface{}) error\n```\nInternalWrapErrorf annotates the error with the ERR\\_INTERNAL code and a stack trace, optional message\n\n```go\nfunc IsCode(code string, err error) bool\n```\nIsCode is a helper to determine if the error is of a specific code\n\n```go\nfunc New(code string, message string) error\n```\nNew returns an error with the supplied message. New also records the stack trace at the point it was called.\n\n```go\nfunc Wrap(err error, code string, message string) error\n```\nWrap returns an error annotating err with a stack trace at the point Wrap is called, and a new supplied message. The previous original is preserved and accessible via Cause(). If err is nil, Wrap returns nil.\n\n## Types\n\n```go\ntype ArgoError interface {\n\tError() string\n\tCode() string\n\tMessage() string\n\tJSON() []byte\n\tStackTrace() errors.StackTrace\n\tFormat(s fmt.State, verb rune)\n}\n```\nArgoError is an error interface that additionally adds support for stack trace, error code, and a JSON representation of the error\n\n","path":"github.com/codefresh-io/argo-workflows/errors","name":"errors","synopsis":"","isRedistributable":true}
