exception

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(err *ExitError)

func IsHttpException

func IsHttpException(err error) bool

func LogContext

func LogContext(err error, extra ...exceptioncontract.Context) exceptioncontract.Context

func MarkLogged

func MarkLogged(err error) error

func Panic

func Panic(err *Error)

Types

type Error

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

func FromError

func FromError(err error) *Error

func FromErrorWithLevel

func FromErrorWithLevel(err error, level loggingcontract.Level) *Error

func NewEmergency

func NewEmergency(message string, context exceptioncontract.Context, causeErr error) *Error

func NewError

func NewError(message string, context exceptioncontract.Context, causeErr error) *Error

func NewInfo

func NewInfo(message string, context exceptioncontract.Context, causeErr error) *Error

func NewWarning

func NewWarning(message string, context exceptioncontract.Context, causeErr error) *Error

func (*Error) AlreadyLogged

func (instance *Error) AlreadyLogged() bool

func (*Error) CauseErr

func (instance *Error) CauseErr() error

func (*Error) Context

func (instance *Error) Context() exceptioncontract.Context

func (*Error) Error

func (instance *Error) Error() string

func (*Error) Level

func (instance *Error) Level() loggingcontract.Level

func (*Error) MarkAsLogged

func (instance *Error) MarkAsLogged()

func (*Error) Message

func (instance *Error) Message() string

func (*Error) SetContext

func (instance *Error) SetContext(context exceptioncontract.Context)

func (*Error) SetContextValue

func (instance *Error) SetContextValue(key string, value any)

func (*Error) Unwrap

func (instance *Error) Unwrap() error

type ExitError

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

func NewExitError

func NewExitError(exitCode int, err *Error) *ExitError

func (*ExitError) Error

func (instance *ExitError) Error() string

func (*ExitError) ErrorValue

func (instance *ExitError) ErrorValue() *Error

func (*ExitError) ExitCode

func (instance *ExitError) ExitCode() int

func (*ExitError) Unwrap

func (instance *ExitError) Unwrap() error

type HttpException

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

func AsHttpException

func AsHttpException(err error) *HttpException

func BadGateway

func BadGateway(message string) *HttpException

func BadRequest

func BadRequest(message string) *HttpException

func Conflict

func Conflict(message string) *HttpException

func Forbidden

func Forbidden(message string) *HttpException

func GatewayTimeout

func GatewayTimeout(message string) *HttpException

func Gone

func Gone(message string) *HttpException

func InternalServerError

func InternalServerError(message string) *HttpException

func MethodNotAllowed

func MethodNotAllowed(message string) *HttpException

func NewHttpException

func NewHttpException(statusCode int, message string) *HttpException

func NewHttpExceptionWithCause

func NewHttpExceptionWithCause(statusCode int, message string, causeErr error) *HttpException

func NotAcceptable

func NotAcceptable(message string) *HttpException

func NotFound

func NotFound(message string) *HttpException

func NotImplemented

func NotImplemented(message string) *HttpException

func PaymentRequired

func PaymentRequired(message string) *HttpException

func RequestTimeout

func RequestTimeout(message string) *HttpException

func ServiceUnavailable

func ServiceUnavailable(message string) *HttpException

func TooManyRequests

func TooManyRequests(message string) *HttpException

func Unauthorized

func Unauthorized(message string) *HttpException

func UnprocessableEntity

func UnprocessableEntity(message string) *HttpException

func ValidationFailed

func ValidationFailed(validationErrors any) *HttpException

func (*HttpException) AlreadyLogged

func (instance *HttpException) AlreadyLogged() bool

func (*HttpException) CauseErr

func (instance *HttpException) CauseErr() error

func (*HttpException) Context

func (instance *HttpException) Context() exceptioncontract.Context

func (*HttpException) Error

func (instance *HttpException) Error() string

func (*HttpException) MarkAsLogged

func (instance *HttpException) MarkAsLogged()

func (*HttpException) Message

func (instance *HttpException) Message() string

func (*HttpException) SetContext

func (instance *HttpException) SetContext(context exceptioncontract.Context)

func (*HttpException) SetContextValue

func (instance *HttpException) SetContextValue(key string, value any)

func (*HttpException) StatusCode

func (instance *HttpException) StatusCode() int

func (*HttpException) Unwrap

func (instance *HttpException) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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