errors

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonErrorResponseFormatter

func JsonErrorResponseFormatter(err exception.Exception, code int, debug, recovered bool, headers map[string]string) contracts.ResponseContract

Types

type AccessDenied

type AccessDenied string

func (AccessDenied) Error

func (ad AccessDenied) Error() string

func (AccessDenied) StatusCode

func (ad AccessDenied) StatusCode() int

type BadRequest

type BadRequest string

func (BadRequest) Error

func (br BadRequest) Error() string

func (BadRequest) StatusCode

func (br BadRequest) StatusCode() int

type ErrorData

type ErrorData struct {
	Code      int
	File      string
	Line      int
	Message   string
	Debug     bool
	Recovered bool
	Fatal     bool
	Traces    []Trace
}

type ErrorHandler

type ErrorHandler interface {
	HandleError(e interface{}, r contracts.RequestContract, recovered bool) contracts.ResponseContract
}

type NotFound

type NotFound string

func (NotFound) Error

func (nf NotFound) Error() string

func (NotFound) StatusCode

func (nf NotFound) StatusCode() int

type StandardErrorHandler

type StandardErrorHandler struct {
	Debug bool
}

func (*StandardErrorHandler) HandleError

func (h *StandardErrorHandler) HandleError(e interface{}, r contracts.RequestContract, recovered bool) contracts.ResponseContract

type Trace

type Trace struct {
	File string
	Line int
}

type Unauthorized

type Unauthorized string

func (Unauthorized) Error

func (u Unauthorized) Error() string

func (Unauthorized) StatusCode

func (u Unauthorized) StatusCode() int

type UnprocessableEntity

type UnprocessableEntity string

func (UnprocessableEntity) Error

func (u UnprocessableEntity) Error() string

func (UnprocessableEntity) StatusCode

func (u UnprocessableEntity) StatusCode() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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