Skip to main content

ServerException

How To use ServerException ?

Status Code 500​

Usage​

With custom configuration​

...
throw new ServerException({
message: 'Server Error',
code: 'INTERNAL_SERVER_ERROR'
});
...

With default configuration​

...
throw new ServerException();
...
/*
output:
{
message: 'Internal Server Error',
code: 'INTERNAL_SERVER_ERROR'
}
*/