ForbiddenErrorclass

new ForbiddenError(message?: string, options?: RequestErrorOptions)
ParamType
messagestring
Optional human-readable description of the privilege failure.
optionsRequestErrorOptions
Return
ForbiddenError
Throw if an operation failed because the user is logged in, but does not have sufficient privileges to access this content.

Throw if an operation failed because the user is logged in, but does not have sufficient privileges to access this content.

  • Sets HTTP status code to 403.

Examples

throw new ForbiddenError("Admins only");