usererr

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasUserMessage

func HasUserMessage(err error) bool

func IsWarning

func IsWarning(err error) bool

func New

func New(msg string, args ...any) error

New creates new user error with the given message. By default these errors are not logged to Sentry. If you want to log the error, use NewLogged

func NewExecError

func NewExecError(source error) error

func NewWarning

func NewWarning(msg string, args ...any) error

func ShouldLogError

func ShouldLogError(err error) bool

ShouldLogError returns true if the it's a logged user error or is a non-user error

func WithLoggedUserMessage

func WithLoggedUserMessage(source error, msg string, args ...any) error

func WithUserMessage

func WithUserMessage(source error, msg string, args ...any) error

Types

type ExitError

type ExitError struct {
	// contains filtered or unexported fields
}

ExitError is an ExitError for a command run on behalf of a user

func (*ExitError) Error

func (e *ExitError) Error() string

func (*ExitError) ExitCode

func (e *ExitError) ExitCode() int

func (*ExitError) Is

func (e *ExitError) Is(target error) bool

func (*ExitError) Unwrap

func (e *ExitError) Unwrap() error

Unwrap provides compatibility for Go 1.13 error chains.

Jump to

Keyboard shortcuts

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