apperr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract interface {
	error
	Code() string
	StatusCode() int
	DetailMsg() string
	Metadata() map[string]any
	Unwrap() error
}

type Error

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

func Conflict

func Conflict(code, publicMessage string, internal error) *Error

func Forbidden

func Forbidden(code, publicMessage string, internal error) *Error

func From

func From(code, publicMessage string, err error) *Error

func InternalError

func InternalError(code, publicMessage string, internal error) *Error

func Invalid

func Invalid(code, publicMessage string, internal error) *Error

func New

func New(
	code string,
	statusCode int,
	publicMessage string,
	internalErr error,
	metadata map[string]any,
) *Error

func NotFound

func NotFound(code, publicMessage string, internal error) *Error

func ServiceUnavailable

func ServiceUnavailable(code, publicMessage string, internal error) *Error

func Unauthorized

func Unauthorized(code, publicMessage string, internal error) *Error

func (*Error) Code

func (e *Error) Code() string

func (*Error) DetailMsg

func (e *Error) DetailMsg() string

func (*Error) Error

func (e *Error) Error() string

func (*Error) Metadata

func (e *Error) Metadata() map[string]any

func (*Error) StatusCode

func (e *Error) StatusCode() int

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