errors

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorBadRequest

func ErrorBadRequest(msg string, errs ...error) core.Error

func ErrorConflict

func ErrorConflict(msg string, errs ...error) core.Error

func ErrorForbidden

func ErrorForbidden(msg string, errs ...error) core.Error

func ErrorInternalServerError

func ErrorInternalServerError(msg string, errs ...error) core.Error

func ErrorN

func ErrorN(status int, msg string, errs ...error) core.Error

func ErrorNotFound

func ErrorNotFound(msg string, errs ...error) core.Error

func ErrorTooManyRequests

func ErrorTooManyRequests(msg string, errs ...error) core.Error

func ErrorUnauthorized

func ErrorUnauthorized(msg string, errs ...error) core.Error

func ErrorUnprocessableEntity

func ErrorUnprocessableEntity(msg string, errs ...error) core.Error

func Status304NotModified

func Status304NotModified() core.Error

Types

type NoopHandler

type NoopHandler struct{}

func NewNoopHandler

func NewNoopHandler() *NoopHandler

func (*NoopHandler) ErrorContentType

func (f *NoopHandler) ErrorContentType(ct string) string

func (*NoopHandler) ErrorSchema

func (f *NoopHandler) ErrorSchema(_ core.Registry) *core.Schema

func (*NoopHandler) NewError

func (f *NoopHandler) NewError(status int, msg string, _ ...error) core.Error

func (*NoopHandler) NewErrorWithContext

func (f *NoopHandler) NewErrorWithContext(_ core.Context, status int, msg string, _ ...error) core.Error

type ProblemDetail

type ProblemDetail struct {
	Type     string              `` /* 170-byte string literal not displayed */
	Title    string              `json:"title,omitempty" example:"Bad Request" doc:"A short, human-readable summary of the problem type."`
	Status   int                 `json:"status,omitempty" example:"400" doc:"HTTP status code"`
	Detail   string              `` /* 153-byte string literal not displayed */
	Instance string              `` /* 163-byte string literal not displayed */
	Errors   []*core.ErrorDetail `json:"errors,omitempty" doc:"Optional list of individual error details"`
}

func (*ProblemDetail) Add

func (e *ProblemDetail) Add(err error)

func (*ProblemDetail) ContentType

func (e *ProblemDetail) ContentType(ct string) string

func (*ProblemDetail) Error

func (e *ProblemDetail) Error() string

func (*ProblemDetail) GetType

func (e *ProblemDetail) GetType() string

func (*ProblemDetail) StatusCode

func (e *ProblemDetail) StatusCode() int

type RFC9457Handler

type RFC9457Handler struct {
	TypeBaseURI  string
	InstanceFunc func(ctx core.Context) string
}

func NewRFC9457Handler

func NewRFC9457Handler() *RFC9457Handler

func NewRFC9457HandlerWithConfig

func NewRFC9457HandlerWithConfig(typeBaseURI string, instanceFunc func(core.Context) string) *RFC9457Handler

func (*RFC9457Handler) ErrorContentType

func (f *RFC9457Handler) ErrorContentType(ct string) string

func (*RFC9457Handler) ErrorSchema

func (f *RFC9457Handler) ErrorSchema(registry core.Registry) *core.Schema

func (*RFC9457Handler) GetTypeBaseURI

func (f *RFC9457Handler) GetTypeBaseURI() string

func (*RFC9457Handler) NewError

func (f *RFC9457Handler) NewError(status int, msg string, errs ...error) core.Error

func (*RFC9457Handler) NewErrorWithContext

func (f *RFC9457Handler) NewErrorWithContext(ctx core.Context, status int, msg string, errs ...error) core.Error

Jump to

Keyboard shortcuts

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