API Docs for: 0.8.0
Show:

ErrorUtils Class

Provides convenience functions to create errors for specific conditions

Item Index

Methods

Methods

badRequest

(
  • [options]
)
Error static

Creates an error that represents an internal server error

Parameters:

  • [options] Object optional
    • [message] String optional
    • [validationErrors] Array optional

Returns:

Error:

custom

(
  • [message='An Error Occurred']
  • [code=500]
)
Error static

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

(
  • [message]
)
Error static

Creates an error that represents a lack of permission (403)

Parameters:

  • [message] String optional

Returns:

Error:

internalServerError

(
  • [message]
)
Error static

Creates an error that represents an internal server error (500)

Parameters:

  • [message] String optional

Returns:

Error:

notAuthorized

(
  • [message]
)
Error static

Creates an error that represents an unauthorized request (401)

Parameters:

  • [message] String optional

Returns:

Error:

notFound

(
  • [message]
)
Error static

Creates an error that represents when a resource is not found (404)

Parameters:

  • [message] String optional

Returns:

Error: