Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // HTTP Errors ErrBadRequest = errors.New("bad request") ErrForbidden = errors.New("forbidden") ErrNotFound = errors.New("not found") ErrConflict = errors.New("conflict") ErrUnprocessableEntity = errors.New("unprocessable entity") ErrInsufficientPermissions = errors.New("insufficient permissions") // User Errors ErrEmailRequired = errors.New("email is required") // Token Errors ErrTokenRequired = errors.New("token is required") // Session Errors ErrSessionNotFound = errors.New("session not found") ErrNoSessionToSignOut = errors.New("no session to sign out: provide session_id or sign_out_all") // Verification Errors ErrVerificationNotFound = errors.New("verification not found") )
Functions ¶
func HandleError ¶
func HandleError(err error, reqCtx *models.RequestContext)
func HandleErrorWithFallback ¶ added in v1.51.0
func HandleErrorWithFallback(err error, reqCtx *models.RequestContext, fallbackStatus int)
HandleErrorWithFallback writes a consistent error response, using fallbackStatus when the error is not one of the recognised sentinels.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.