resterrors

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_KEY_ERROR = "details"
)

Variables

View Source
var (
	AppErr              = &AppError{Err: "Server error"}
	NotFoundErr         = &NotFoundError{}
	PermissionDeniedErr = &PermissionDeniedError{Err: "Permission denied"}
	ValidErr            = &ValidError{}
	InvalidPasswordErr  = &InvalidPasswordError{}
)

Functions

func RestErrorResponce

func RestErrorResponce(w http.ResponseWriter, restError RestError)

Types

type AppError

type AppError struct {
	BaseError
	Err string
}

====== PermissionDeniedError ======

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) RestError

func (e *AppError) RestError() map[string][]string

func (AppError) Status

func (AppError) Status() int

type BaseError

type BaseError struct {
	Err string
}

====== NotFoundError ======

func (*BaseError) Error

func (b *BaseError) Error() string

func (*BaseError) RestError

func (e *BaseError) RestError() map[string][]string

func (BaseError) Status

func (BaseError) Status() int

type InvalidPasswordError

type InvalidPasswordError struct {
	BaseError
}

====== PermissionDeniedError ======

func (*InvalidPasswordError) Error

func (v *InvalidPasswordError) Error() string

func (*InvalidPasswordError) RestError

func (e *InvalidPasswordError) RestError() map[string][]string

func (InvalidPasswordError) Status

func (InvalidPasswordError) Status() int

type ModelInstanceError

type ModelInstanceError struct {
	BaseError
	Err error
}

====== ModelInstanceError ======

func (*ModelInstanceError) Error

func (v *ModelInstanceError) Error() string

func (*ModelInstanceError) RestError

func (e *ModelInstanceError) RestError() map[string][]string

func (ModelInstanceError) Status

func (ModelInstanceError) Status() int

type NotFoundError

type NotFoundError struct{ BaseError }

====== NotFoundError ======

func (NotFoundError) Error

func (NotFoundError) Error() string

func (*NotFoundError) RestError

func (e *NotFoundError) RestError() map[string][]string

func (NotFoundError) Status

func (NotFoundError) Status() int

type PermissionDeniedError

type PermissionDeniedError struct {
	BaseError
	Err string
}

====== PermissionDeniedError ======

func (*PermissionDeniedError) Error

func (p *PermissionDeniedError) Error() string

func (*PermissionDeniedError) RestError

func (e *PermissionDeniedError) RestError() map[string][]string

func (PermissionDeniedError) Status

func (PermissionDeniedError) Status() int

type RestError

type RestError interface {
	Error() string
	Status() int
	RestError() map[string][]string
}

type UnauthorizedError

type UnauthorizedError struct {
	BaseError
	Err string
}

====== UnauthorizedError ======

func (*UnauthorizedError) Error

func (p *UnauthorizedError) Error() string

func (*UnauthorizedError) RestError

func (e *UnauthorizedError) RestError() map[string][]string

func (UnauthorizedError) Status

func (UnauthorizedError) Status() int

type ValidError

type ValidError struct {
	BaseError
	Field string
}

====== PermissionDeniedError ======

func (*ValidError) Error

func (v *ValidError) Error() string

func (*ValidError) RestError

func (e *ValidError) RestError() map[string][]string

func (ValidError) Status

func (ValidError) Status() int

Jump to

Keyboard shortcuts

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