This module contains the error handler middleware.
Methods
# inner errorHandler(err, req, res, next)
Error Handler Middleware
This middleware handles all errors thrown by the application and sends a response to the client.
Parameters:
Name | Type | Description |
---|---|---|
err |
Error
|
|
req |
Request
|
|
res |
Response
|
|
next |
*
|
# inner handleValidationErr(err) → {CustomAPIError}
Handles Validation Errors, these errors are thrown by mongoose when a model validation fails
Parameters:
Name | Type | Description |
---|---|---|
err |
Error
|
CustomAPIError