ErrorUtils Class
Provides convenience functions to create errors for specific conditions
Item Index
Methods
- badRequest static
- custom static
- forbidden static
- internalServerError static
- notAuthorized static
- notFound static
Methods
badRequest
(
Error
static
-
[options]
Creates an error that represents an internal server error
Parameters:
-
[options]
Object optional-
[message]
String optional -
[validationErrors]
Array optional
-
Returns:
Error:
custom
(
Error
static
-
[message='An Error Occurred']
-
[code=500]
Creates a custom error with a specific message and status code
Parameters:
-
[message='An Error Occurred']
String optional -
[code=500]
Number optional
Returns:
Error:
forbidden
(
Error
static
-
[message]
Creates an error that represents a lack of permission (403)
Parameters:
-
[message]
String optional
Returns:
Error:
internalServerError
(
Error
static
-
[message]
Creates an error that represents an internal server error (500)
Parameters:
-
[message]
String optional
Returns:
Error:
notAuthorized
(
Error
static
-
[message]
Creates an error that represents an unauthorized request (401)
Parameters:
-
[message]
String optional
Returns:
Error:
notFound
(
Error
static
-
[message]
Creates an error that represents when a resource is not found (404)
Parameters:
-
[message]
String optional
Returns:
Error: