errs

package
v0.0.0-...-6ac1af6 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValidation              = errors.New("validation error")
	ErrNotFound                = errors.New("not found error")
	ErrDuplicateEntity         = errors.New("duplicate entity")
	ErrForbidden               = errors.New("forbidden error")
	ErrUnauthorized            = errors.New("unauthorized error")
	ErrInvalidToken            = errors.New("invalid token")
	ErrEmptyJWTSecretKey       = errors.New("empty jwt secret key")
	ErrUnexpectedSigningMethod = errors.New("unexpected signing method")

	// Validation Errors which could be returned by "github.com/golang-jwt/jwt/v4" package
	GoJwtValidationErrors = []error{
		goJwt.ErrTokenMalformed,
		goJwt.ErrTokenExpired,
		goJwt.ErrTokenNotValidYet,
		goJwt.ErrTokenInvalidClaims,
	}
)

Functions

func GetHttpStatusCodeFromError

func GetHttpStatusCodeFromError(err error) int

func NewDuplicateEntity

func NewDuplicateEntity(errMsg string) error

func NewForbiddenError

func NewForbiddenError(errMsg string) error

func NewNotFoundError

func NewNotFoundError(errMsg string) error

func NewUnauthorizedError

func NewUnauthorizedError(errMsg string) error

func NewValidationError

func NewValidationError(errMsg string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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