http_errors
Api Code Documentation / Exports / http_errors
Table of contents
Functions
Functions
toHttpError
▸ toHttpError(error, version?): Object
Converts an error object to an appropriate http error
Parameters
| Name | Type | Default value |
|---|---|---|
error | unknown | undefined |
version | string | "1.0" |
Returns
Object
an error object containing appropriate status code and an ErrorBody
| Name | Type |
|---|---|
body | ErrorBody |
code | number |