NewError

package
v0.0.0-...-83330ae Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound        = errors.New("not found")
	ErrUnauthorized    = errors.New("unauthorized")
	ErrForbiddenAccess = errors.New("forbidden access")
)
View Source
var (
	ErrorGeneral         = New("internal server error", http.StatusInternalServerError)
	ErrorBadRequest      = New("bad request", http.StatusBadRequest)
	ErrorNotFound        = New(ErrNotFound.Error(), http.StatusNotFound)
	ErrorUnauthorized    = New(ErrUnauthorized.Error(), http.StatusUnauthorized)
	ErrorForbiddenAccess = New(ErrForbiddenAccess.Error(), http.StatusForbidden)
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Message  string
	HttpCode int
}

func New

func New(msg string, httpCode int) Error

func (Error) Error

func (e Error) Error() string

Jump to

Keyboard shortcuts

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