http-errors-handle
Module responsible for encapsulating all http error requests and returns the correct exception.
Example
const httpErrorsHandle = ;const axios = ;var app = ; app
Error Properties
message
- the traditional error message, which should be kept short and all single linestatus
- the status code of the error, mirroringstatusCode
for general compatibilitystatusCode
- the status code of the error, defaulting to500
httpErrorsHandle([request], [message])
Create a new handle error object with the given message msg
.
The error object inherits from createError.HttpError
.
var resp = ;
status: 500
- the status code as a numbermessage
- the message of the error, defaulting to node's text for that status code.
## License
[MIT]