errors

package
v0.0.0-...-56fc341 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserAlreadyExists      = NewError("user already exists", 400)
	ErrNotFound               = NewError("not found", 404)
	ErrInvalidEmailOrPassword = NewError("invalid password or email", 400)
	ErrInvalidOTP             = NewError("invalid otp", 400)
	ErrUnathorized            = NewError("unauthorized", 401)
	ErrForbidden              = NewError("forbidden", 403) //client's identity is known but has no permission to access the resource. has to do with roles and permissions
	ErrInternalServer         = NewError("internal server error", 500)
	ErrFileTooLarge           = NewError("file too large", 413)
	ErrInvalidObjectID        = NewError("invalid object id", 400)
	ErrCategoryAlreadyExists  = NewError("category already exists", 400)
	ErrUserAlreadyVerified    = NewError("user already verified", 409)
)

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Msg        string
	StatusCode int
}

func NewError

func NewError(msg string, statusCode int) *AppError

func (*AppError) Error

func (e *AppError) Error() string

Jump to

Keyboard shortcuts

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