apperr

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code string
const (
	CodeInvalidArgument Code = "INVALID_ARGUMENT"
	CodeUnauthorized    Code = "UNAUTHORIZED"
	CodeForbidden       Code = "FORBIDDEN"
	CodeNotFound        Code = "NOT_FOUND"
	CodeConflict        Code = "CONFLICT"
	CodeTooManyRequests Code = "TOO_MANY_REQUESTS"
	CodeUnavailable     Code = "UNAVAILABLE"
	CodeTimeout         Code = "TIMEOUT"
	CodeInternal        Code = "INTERNAL"
)

type Details

type Details map[string]any

func Fields

func Fields(pairs ...any) Details

type Error

type Error struct {
	Code    Code
	Message string
	Details Details
	Cause   error
}

func As

func As(err error) (*Error, bool)

func New

func New(code Code, message string, details ...Details) *Error

func Wrap

func Wrap(cause error, code Code, message string, details ...Details) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) IsClientError added in v0.5.0

func (e *Error) IsClientError() bool

IsClientError reports whether the error represents an expected client outcome.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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