httpErrors
httpErrors(
statusCode?,options?):Error
Defined in: utils/http-errors.js:51
Parameters
Section titled “Parameters”statusCode?
Section titled “statusCode?”number = 500
HTTP status code
options?
Section titled “options?”RFC 9457 Problem Details fields
detail?
Section titled “detail?”string = message
RFC 9457 detail (human-readable explanation)
headers?
Section titled “headers?”[string, string][]
Response headers to attach
instance?
Section titled “instance?”string
RFC 9457 instance URI identifying the specific occurrence
message?
Section titled “message?”string
Alias for detail (backward compat)
originalError?
Section titled “originalError?”Error
Underlying error
retryAfter?
Section titled “retryAfter?”string | number
Retry-After value (seconds or HTTP-date).
Auto-appended to headers as ['Retry-After', String(value)] and included in toJSON().
string = ...
RFC 9457 type URI (defaults to MDN docs link)
Returns
Section titled “Returns”Error
- Error with RFC 9457 properties and
toJSON()method