MCPcopy
hub / github.com/pocketbase/pocketbase / NewForbiddenError

Function NewForbiddenError

tools/router/error.go:85–91  ·  view source on GitHub ↗

NewForbiddenError creates and returns 403 ApiError.

(message string, rawErrData any)

Source from the content-addressed store, hash-verified

83
84// NewForbiddenError creates and returns 403 ApiError.
85func NewForbiddenError(message string, rawErrData any) *ApiError {
86 if message == "" {
87 message = "You are not allowed to perform this request."
88 }
89
90 return NewApiError(http.StatusForbidden, message, rawErrData)
91}
92
93// NewUnauthorizedError creates and returns 401 ApiError.
94func NewUnauthorizedError(message string, rawErrData any) *ApiError {

Callers 5

TestNewForbiddenErrorFunction · 0.92
TestToApiErrorFunction · 0.92
NewForbiddenErrorFunction · 0.92
ForbiddenErrorMethod · 0.70

Calls 1

NewApiErrorFunction · 0.70

Tested by 2

TestNewForbiddenErrorFunction · 0.74
TestToApiErrorFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…