ForbiddenException
Defines an HTTP exception for Forbidden type errors.
class ForbiddenException extends HttpException {
constructor(objectOrError?: any, descriptionOrOptions: string | HttpExceptionOptions = 'Forbidden')
// inherited from nest/packages/common/HttpException
static createBody<Body extends Record<string, unknown>>(arg0: HttpExceptionBodyMessage | Body, arg1?: HttpExceptionBodyMessage, statusCode?: number): HttpExceptionBody | Body
static getDescriptionFrom(descriptionOrOptions: string | HttpExceptionOptions): string
static getHttpExceptionOptionsFrom(descriptionOrOptions: string | HttpExceptionOptions): HttpExceptionOptions
static extractDescriptionAndOptionsFrom(descriptionOrOptions: string | HttpExceptionOptions): DescriptionAndOptions
constructor(response: string | Record<string, any>, status: number, options?: HttpExceptionOptions)
cause: unknown
initCause(): void
initMessage()
initName(): void
getResponse(): string | object
getStatus(): number
// inherited from nest/packages/common/IntrinsicException
}
See also
Constructor
Instantiate a |
|||||||||
Parameters
Examples
|
|||||||||
Usage NotesThe HTTP response status code will be 403.
By default, the JSON response body contains two properties:
If the parameter |