{"modulePath":"github.com/tinyci/ci-agents","version":"v0.2.3","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Variables\n\n```go\nvar (\n\t// ErrNotFound is a generic error for things that don't exist.\n\tErrNotFound = New(\"not found\")\n\n\t// ErrInvalidAuth is for authentication events that do not succeed.\n\tErrInvalidAuth = New(\"invalid authentication\")\n\n\t// ErrRunCanceled is thrown to github when the run is canceled.\n\tErrRunCanceled = New(\"run canceled by user intervention\")\n)\n```\n\n## Functions\n\n```go\nfunc Errorf(f string, args ...interface{}) error\n```\nErrorf is the formatted version of New().\n\n```go\nfunc MapError(err error) error\n```\nMapError finds an error by string and returns an appropriate Error for it. The stack will NOT be preserved in the error and you will want to Wrap() it. If there is no potential mapping, a new Error is returned.\n\n```go\nfunc New(res interface{}) error\n```\nNew constructs a new error\n\n## Types\n\n```go\ntype Error struct {\n\tErrs   []string        `json:\"errors\"`\n\tFrames []xerrors.Frame `json:\"-\"`\n\tLog    bool            `json:\"log\"`\n}\n```\nError encapsulates a series of errors.\n\n```go\nfunc NewNoLog(str string) Error\n```\nNewNoLog returns an error which will not be logged.\n\n```go\nfunc (e Error) Contains(err interface{}) bool\n```\nContains checks if e contains err. Strings and errors are supported; otherwise it will return false.\n\n```go\nfunc (e Error) Copy() Error\n```\nCopy makes a copy of the error: for great justice\n\n```go\nfunc (e Error) Error() string\n```\n\n```go\nfunc (e Error) Exit()\n```\nExit exits the program leveraging the error for output before exiting with error code 1. If DEBUG is set, it will output a stack trace.\n\n```go\nfunc (e Error) Format(f fmt.State, c rune)\n```\nFormat formats the errors implementing fmt.Formatter\n\n```go\nfunc (e Error) FormatError(p xerrors.Printer) error\n```\nFormatError implements xerrors.Formatter and allows it to provide extended detail.\n\n```go\nfunc (e *Error) GetLog() bool\n```\nGetLog returns the state of the log argument; for usage by error reporting utilities.\n\n```go\nfunc (e *Error) SetLog(log bool)\n```\nSetLog sets the state for whether or not logging is permitted.\n\n```go\nfunc (e Error) String() string\n```\n\n```go\nfunc (e Error) ToGRPC(code codes.Code) error\n```\nToGRPC converts an error to a coded GRPC error, useful in returns from API handlers.\n\n```go\nfunc (e Error) Wrap(err interface{}) Error\n```\nWrap wraps an error string. If the original error is nil, no wrapping occurs and nil is returned.\n\n```go\nfunc (e Error) Wrapf(str string, args ...interface{}) Error\n```\nWrapf wraps an error with formatting\n\n","path":"github.com/tinyci/ci-agents/errors","name":"errors","synopsis":"","isRedistributable":true}
