errors

package
v1.51.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HTTP Errors
	ErrBadRequest              = errors.New("bad request")
	ErrUnauthorized            = errors.New("unauthorized")
	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.

func StatusFor added in v1.49.0

func StatusFor(err error) (int, bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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