{"modulePath":"github.com/brevdev/brev-cli","version":"v0.6.337","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\n## Constants\n\n```go\nconst DeclineToLoginMessage = \"declined to login\"\n```\n\n## Variables\n\n```go\nvar As = stderrors.As\n```\n\n```go\nvar Errorf = fmt.Errorf\n```\n\n```go\nvar Is = stderrors.Is\n```\n\n```go\nvar NetworkErrorMessage = \"possible internet connection problem\"\n```\n\n```go\nvar New = stderrors.New\n```\n\n```go\nvar Unwrap = stderrors.Unwrap\n```\n\n## Functions\n\n```go\nfunc CombineByString(err error) error\n```\nif multi err, combine similar errors\n\n```go\nfunc Flatten(err error) []error\n```\nflattens error tree\n\n```go\nfunc Join(errs ...error) error\n```\n\n```go\nfunc Root(err error) error\n```\n\n```go\nfunc Roots(errs []error) error\n```\n\n```go\nfunc Unwraps(err error) []error\n```\n\n```go\nfunc Wrap(err error, msg string) error\n```\n\n```go\nfunc WrapAndTrace(err error) error\n```\nWrapAndTrace attaches a stack trace to err for debugging and error reporting.\n\nThe message of the returned error is unchanged, so errors surfaced to users never carry stack frames. Use %+v (for example in dev/debug builds) to print the captured stack.\n\n## Types\n\n```go\ntype BrevError interface {\n\t// Error returns a user-facing string explaining the error\n\tError() string\n\n\t// Directive returns a user-facing string explaining how to overcome the error\n\tDirective() string\n}\n```\n\n```go\ntype CredentialsFileNotFound struct{}\n```\n\n```go\nfunc (e *CredentialsFileNotFound) Directive() string\n```\n\n```go\nfunc (e *CredentialsFileNotFound) Error() string\n```\n\n```go\ntype DeclineToLoginError struct{}\n```\n\n```go\nfunc (d *DeclineToLoginError) Directive() string\n```\n\n```go\nfunc (d *DeclineToLoginError) Error() string\n```\n\n```go\ntype ErrReportBreadCrumb struct {\n\tType     string\n\tCategory string\n\tMessage  string\n\tLevel    string\n}\n```\n\n```go\ntype ErrorReporter interface {\n\tSetup() func()\n\tFlush()\n\tReportMessage(string) string\n\tReportError(error) string\n\tAddTag(key string, value string)\n\tSetUser(user ErrorUser)\n\tAddBreadCrumb(bc ErrReportBreadCrumb)\n}\n```\n\n```go\nfunc GetDefaultErrorReporter() ErrorReporter\n```\n\n```go\ntype ErrorUser struct {\n\tID       string\n\tUsername string\n\tEmail    string\n}\n```\n\n```go\ntype NvidiaMigrationError struct {\n\tMessage string\n}\n```\n\n```go\nfunc NewNvidiaMigrationError(msg string) *NvidiaMigrationError\n```\n\n```go\nfunc (e NvidiaMigrationError) Directive() string\n```\n\n```go\nfunc (e NvidiaMigrationError) Error() string\n```\n\n```go\ntype SentryErrorReporter struct{}\n```\n\n```go\nfunc (s SentryErrorReporter) AddBreadCrumb(bc ErrReportBreadCrumb)\n```\n\n```go\nfunc (s SentryErrorReporter) AddTag(key string, value string)\n```\n\n```go\nfunc (s SentryErrorReporter) Flush()\n```\n\n```go\nfunc (s SentryErrorReporter) ReportError(e error) string\n```\n\n```go\nfunc (s SentryErrorReporter) ReportMessage(msg string) string\n```\n\n```go\nfunc (s SentryErrorReporter) SetUser(user ErrorUser)\n```\n\n```go\nfunc (s SentryErrorReporter) Setup() func()\n```\n\n```go\ntype ValidationError struct {\n\tMessage string\n}\n```\n\n```go\nfunc NewValidationError(message string) ValidationError\n```\n\n```go\nfunc (v ValidationError) Error() string\n```\n\n```go\ntype WorkspaceNotRunning struct {\n\tStatus string\n}\n```\n\n```go\nfunc (e WorkspaceNotRunning) Error() string\n```\n\n","path":"github.com/brevdev/brev-cli/pkg/errors","name":"errors","synopsis":"","isRedistributable":true}
