errors

package
v0.0.0-...-00694c9 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(kind Kind, err error) error

Types

type DefaultMapper

type DefaultMapper struct{}

func (DefaultMapper) MapError

type DefaultWriter

type DefaultWriter struct{}

func (DefaultWriter) WriteError

type Error

type Error struct {
	Kind Kind
	Err  error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorMapper

type ErrorMapper interface {
	MapError(context.Context, httpadapter.MethodSpec, error) *HTTPError
}

type ErrorWriter

type ErrorWriter interface {
	WriteError(context.Context, Response, httpadapter.MethodSpec, *HTTPError) error
}

type HTTPError

type HTTPError struct {
	Status  int    `json:"-"`
	Code    string `json:"code"`
	Message string `json:"message"`
	Details any    `json:"details,omitempty"`
	Cause   error  `json:"-"`
}

type Kind

type Kind string
const (
	KindBinding    Kind = "binding"
	KindValidation Kind = "validation"
	KindConnect    Kind = "connect"
	KindInternal   Kind = "internal"
)

type Response

type Response interface {
	JSON(int, any) error
}

Jump to

Keyboard shortcuts

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