errors

package
v0.6.291 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Errorf = fmt.Errorf
View Source
var NetworkErrorMessage = "possible internet connection problem"
View Source
var WrapAndTrace = WrapAndTraceInMsg

Functions

func CombineByString added in v0.6.288

func CombineByString(err error) error

if multi err, combine similar errors

func ErrorContains added in v0.6.288

func ErrorContains(err error, substr string) bool

func ErrorContainsAny added in v0.6.288

func ErrorContainsAny(err error, substrs ...string) bool

func Flatten added in v0.6.288

func Flatten(err error) []error

flattens error tree

func HandleErrDefer added in v0.6.288

func HandleErrDefer(f func() error)

func IsAny added in v0.6.288

func IsAny(err error, errs ...error) bool

func IsErrorExcept added in v0.6.288

func IsErrorExcept(err error, errs ...error) bool

func IsErrorExceptSubstr added in v0.6.288

func IsErrorExceptSubstr(err error, substr ...string) bool

func Join added in v0.6.288

func Join(errs ...error) error

func MakeErrorMessage

func MakeErrorMessage(message string) string

func Root added in v0.6.288

func Root(err error) error

func Roots added in v0.6.288

func Roots(errs []error) error

func Unwraps added in v0.6.288

func Unwraps(err error) []error

func Wrap added in v0.6.288

func Wrap(err error, msg string) error

func WrapAndTrace2 added in v0.6.288

func WrapAndTrace2[T any](t T, err error) (T, error)

func WrapAndTraceInMsg added in v0.6.288

func WrapAndTraceInMsg(err error) error

Types

type BrevError

type BrevError interface {
	// Error returns a user-facing string explaining the error
	Error() string

	// Directive returns a user-facing string explaining how to overcome the error
	Directive() string
}

type CredentialsFileNotFound

type CredentialsFileNotFound struct{}

func (*CredentialsFileNotFound) Directive

func (e *CredentialsFileNotFound) Directive() string

func (*CredentialsFileNotFound) Error

func (e *CredentialsFileNotFound) Error() string

type DeclineToLoginError

type DeclineToLoginError struct{}

func (*DeclineToLoginError) Directive

func (d *DeclineToLoginError) Directive() string

func (*DeclineToLoginError) Error

func (d *DeclineToLoginError) Error() string

type ErrReportBreadCrumb added in v0.6.72

type ErrReportBreadCrumb struct {
	Type     string
	Category string
	Message  string
	Level    string
}

type ErrorReporter added in v0.6.63

type ErrorReporter interface {
	Setup() func()
	Flush()
	ReportMessage(string) string
	ReportError(error) string
	AddTag(key string, value string)
	SetUser(user ErrorUser)
	AddBreadCrumb(bc ErrReportBreadCrumb)
}

func GetDefaultErrorReporter added in v0.6.63

func GetDefaultErrorReporter() ErrorReporter

type ErrorUser added in v0.6.63

type ErrorUser struct {
	ID       string
	Username string
	Email    string
}

type SentryErrorReporter added in v0.6.63

type SentryErrorReporter struct{}

func (SentryErrorReporter) AddBreadCrumb added in v0.6.72

func (s SentryErrorReporter) AddBreadCrumb(bc ErrReportBreadCrumb)

func (SentryErrorReporter) AddTag added in v0.6.63

func (s SentryErrorReporter) AddTag(key string, value string)

func (SentryErrorReporter) Flush added in v0.6.63

func (s SentryErrorReporter) Flush()

func (SentryErrorReporter) ReportError added in v0.6.63

func (s SentryErrorReporter) ReportError(e error) string

func (SentryErrorReporter) ReportMessage added in v0.6.63

func (s SentryErrorReporter) ReportMessage(msg string) string

func (SentryErrorReporter) SetUser added in v0.6.63

func (s SentryErrorReporter) SetUser(user ErrorUser)

func (SentryErrorReporter) Setup added in v0.6.63

func (s SentryErrorReporter) Setup() func()

type ValidationError added in v0.6.63

type ValidationError struct {
	Message string
}

func NewValidationError added in v0.6.63

func NewValidationError(message string) ValidationError

func (ValidationError) Error added in v0.6.63

func (v ValidationError) Error() string

type WorkspaceNotRunning added in v0.6.91

type WorkspaceNotRunning struct {
	Status string
}

func (WorkspaceNotRunning) Error added in v0.6.91

func (e WorkspaceNotRunning) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL