ForbiddenException
How To use ForbiddenException ?
Status Code 403
Usage
With custom configuration
...
if (haveNoAccess) {
throw new ForbiddenException({
code: 'FORBIDDEN',
message: 'You have no access'
});
}
...
With default configuration
...
if (haveNoAccess) {
throw new ForbiddenException();
}
...
/*
output:
{
message: 'Forbidden',
code: 'FORBIDDEN'
}
*/