exception

package
v0.0.0-...-2c8b9bc Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeInternal         = "ErrInternal"
	TypeValidation       = "ErrValidation"
	TypeNotFound         = "ErrNotFound"
	TypePermissionDenied = "ErrPermissionDenied"
	TypeTokenExpired     = "TokenExpired"
	TypeTokenInvalid     = "TokenInvalid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Err

type Err = map[string][]string

type Exception

type Exception struct {
	Type    string `json:"-"`
	Message string `json:"-"`
	Cause   error  `json:"-"`
	Errors  Err    `json:"errors"`
}

func Into

func Into(err error) *Exception

func New

func New(kind, message string, err error) *Exception

func Validation

func Validation() *Exception

func (*Exception) AddError

func (e *Exception) AddError(key, msg string) *Exception

func (*Exception) Error

func (fail *Exception) Error() string

func (*Exception) HasError

func (e *Exception) HasError() bool

Jump to

Keyboard shortcuts

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