errorsx

package
v1.0.52 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 4 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 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 ErrorCodeExtractMessageFunc added in v1.0.46

type ErrorCodeExtractMessageFunc func(apiError.Error) string

type ErrorCodeExtractMessageMetaFunc added in v1.0.46

type ErrorCodeExtractMessageMetaFunc func(apiError.Error, map[string]interface{}) string

type ErrorCodeOption added in v1.0.46

type ErrorCodeOption gn.Option[errorCodeConfig]

func ErrorCodeErrorMessage added in v1.0.14

func ErrorCodeErrorMessage(f ErrorCodeExtractMessageFunc) ErrorCodeOption

type HttpStatusCodeOption added in v1.0.46

type HttpStatusCodeOption gn.Option[httpStatusCodeConfig]

func HttpStatusCodeErrorMessage added in v1.0.14

func HttpStatusCodeErrorMessage(f ErrorCodeExtractMessageFunc) HttpStatusCodeOption

type InvalidUserInputOption added in v1.0.46

type InvalidUserInputOption gn.Option[invalidUserInputConfig]

func InvalidUserInputErrorMessage added in v1.0.14

func InvalidUserInputErrorMessage(f ErrorCodeExtractMessageMetaFunc) InvalidUserInputOption

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