Skip to main content

NotFoundException

How To use NotFoundException ?

Status Code 404

Usage

With custom configuration

...
if (isNotFound) {
throw new NotFoundException({
code: 'USER_NOT_FOUND',
message: 'user not found',
});
}
...

With default configuration

...
if (isNotFound) {
throw new NotFoundException();
}
...
/*
output:
{
message: 'Not Found',
code: 'NOT_FOUND'
}
*/