errors

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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                      `json:"code"`
	StatusCode int                      `json:"status_code"`
	File       string                   `json:"file,omitempty"`
	Line       int                      `json:"line,omitempty"`
	Message    string                   `json:"message"`
	Debug      bool                     `json:"debug,omitempty"`
	Recovered  bool                     `json:"recovered,omitempty"`
	Fatal      bool                     `json:"fatal,omitempty"`
	Traces     []Trace                  `json:"traces,omitempty"`
	Errors     validation.ValidateError `json:"errors,omitempty"`
}

func ParseError added in v0.0.15

func ParseError(e interface{}, debug, recovered bool) ErrorData

func ToErrorData added in v0.0.17

func ToErrorData(code, statusCode int, err exception.Exception, debug, recoverd bool) (data ErrorData)

type ErrorHandler

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

type JsonError added in v0.0.17

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

func Json added in v0.0.17

func Json(message string, code int) *JsonError

func (JsonError) Error added in v0.0.17

func (j JsonError) Error() string

func (JsonError) ResponseCode added in v0.0.17

func (j JsonError) ResponseCode() int

func (*JsonError) Status added in v1.1.9

func (j *JsonError) Status(code int) *JsonError

func (JsonError) StatusCode added in v0.0.17

func (j JsonError) StatusCode() int

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
	Callback func(ed ErrorData, r contracts.RequestContract)
}

func (*StandardErrorHandler) HandleError

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

type StatusCode added in v0.0.17

type StatusCode int

func (StatusCode) Error added in v0.0.17

func (c StatusCode) Error() string

func (StatusCode) StatusCode added in v0.0.17

func (c StatusCode) StatusCode() int

type Trace

type Trace struct {
	File string `json:"file"`
	Line int    `json:"line"`
}

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