errors

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InsecureJWT = errors.New("jwt is not secure")

	BadRequestMethod = errors.New(http.StatusText(http.StatusMethodNotAllowed))
	InternalError    = errors.New(http.StatusText(http.StatusInternalServerError))

	NoJSONBody   = errors.New("unable to decode JSON")
	InvalidEmail = errors.New("invalid email")
	InvalidInput = errors.New("invalid input")

	FailedLogin          = errors.New("invalid username or password")
	AlreadyRegistered    = errors.New("an account already exists for this email")
	VerificationNotFound = errors.New("invalid verification code")
	VerificationExpired  = errors.New("verification code was already used")

	UserNotFound  = errors.New("user does not exist")
	PostNotFound  = errors.New("post does not exist")
	ResetNotFound = errors.New("invalid password reset code")

	BadCSRF           = errors.New("missing CSRF header")
	BadOrigin         = errors.New("invalid origin header")
	RouteUnauthorized = errors.New("you don't have permission to view this resource")
	RouteNotFound     = errors.New("route not found")
	ExpiredToken      = errors.New("your access token expired")
	InvalidToken      = errors.New("your access token is invalid")
)

Functions

func GetCode

func GetCode(e error) (bool, int)

GetCode is a helper to get the relevant code for an error, or just return 500

Types

This section is empty.

Jump to

Keyboard shortcuts

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