status

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInternalServerError will throw if any the Internal Server Error happen
	ErrInternalServerError = errors.New("Internal Server Error")
	// ErrNotFound will throw if the requested item is not exists
	ErrNotFound = errors.New("Your requested Item is not found")
	// ErrConflict will throw if the current action already exists
	ErrConflict = errors.New("Item already exist")
	// ErrBadParamInput will throw if the given request-body or params is not valid
	ErrBadParamInput = errors.New("Given Param is not valid")
	// ErrUnauthorized will throw if user not login or token expired
	ErrUnauthorized = errors.New("Unauthorized")
	// ErrForbidden will throw if user has no authz
	ErrForbidden = errors.New("Forbidden")
	// ErrConfig will throw if config has error
	ErrConfig = errors.New("Config Error")
)

Functions

func GetStatusCode

func GetStatusCode(err error) int

GetStatusCode - Translate err to status code

Types

type ResponseError added in v0.1.3

type ResponseError struct {
	Message string `json:"message"`
}

ResponseError represent the reseponse error struct

Jump to

Keyboard shortcuts

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