errorsx

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(err error, check Check) error

func ErrorCodeErrorMessage added in v1.0.14

func ErrorCodeErrorMessage(f func(apiErr apiError.Error) string) errorCodeOption

func HttpStatusCodeErrorMessage added in v1.0.14

func HttpStatusCodeErrorMessage(f func(apiErr apiError.Error) string) httpStatusCodeOption

func InvalidUserInputErrorMessage added in v1.0.14

func InvalidUserInputErrorMessage(
	f func(apiErr apiError.Error, metaItem map[string]interface{}) string,
) invalidUserInputOption

func Is added in v1.0.14

func Is(err error, check Check) bool

Types

type Check

type Check func(err error) error

func And added in v1.0.14

func And(checks ...Check) Check

func ErrorCode added in v1.0.14

func ErrorCode(errorCode errorCode.ErrorCode, auxOptions ...errorCodeOption) Check

func HttpStatusCode added in v1.0.14

func HttpStatusCode(httpStatusCode int, auxOptions ...httpStatusCodeOption) Check

func InvalidUserInput added in v1.0.14

func InvalidUserInput(parameterName string, auxOptions ...invalidUserInputOption) Check

func Meta added in v1.0.14

func Meta(
	errorMessage func(apiErr apiError.Error, metaItem map[string]interface{}) string,
) Check

func Or added in v1.0.14

func Or(checks ...Check) Check

type UserError

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

func AsUserError

func AsUserError(err error) *UserError

func NewUserError

func NewUserError(message string, previous error) *UserError

func (*UserError) As

func (e *UserError) As(target interface{}) bool

func (*UserError) Error

func (e *UserError) Error() string

func (*UserError) Is

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

func (*UserError) Unwrap

func (e *UserError) Unwrap() error

Jump to

Keyboard shortcuts

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