errorsx

package
v0.0.0-...-0a572d1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 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

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

func HttpStatusCodeErrorMessage

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

func InvalidUserInputErrorMessage

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

func Is

func Is(err error, check Check) bool

Types

type Check

type Check func(err error) error

func And

func And(checks ...Check) Check

func ErrorCode

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

func HttpStatusCode

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

func InvalidUserInput

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

func Meta

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

func Or

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