MCPcopy
hub / github.com/pocketbase/pocketbase / NewUnauthorizedError

Function NewUnauthorizedError

tools/router/error.go:94–100  ·  view source on GitHub ↗

NewUnauthorizedError creates and returns 401 ApiError.

(message string, rawErrData any)

Source from the content-addressed store, hash-verified

92
93// NewUnauthorizedError creates and returns 401 ApiError.
94func NewUnauthorizedError(message string, rawErrData any) *ApiError {
95 if message == "" {
96 message = "Missing or invalid authentication."
97 }
98
99 return NewApiError(http.StatusUnauthorized, message, rawErrData)
100}
101
102// NewInternalServerError creates and returns 500 ApiError.
103func NewInternalServerError(message string, rawErrData any) *ApiError {

Callers 3

TestNewUnauthorizedErrorFunction · 0.92
NewUnauthorizedErrorFunction · 0.92
UnauthorizedErrorMethod · 0.70

Calls 1

NewApiErrorFunction · 0.70

Tested by 1

TestNewUnauthorizedErrorFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…