valueError | any optionsOptions? Return value: HttpResponse
Converts error to a plain object
(RFC 7807, "problem details") to use
in an HTTP response.
error should be an Error instance, but invalid errors are automatically
normalized.
Options
Type: object
The options and the return value have the same shape
(RFC 7807). Options can be passed
either as an argument to
errorHttpResponse() or be set to
error.http.
Options are validated: an exception is thrown if their syntax is invalid.
type
Type: urlString Default: undefined
URI identifying and documenting the error class. Ideally, each error class
should set one.
status
Type: integer Default: undefined
HTTP status code.
title
Type: string Default: error.name
Error class name.
detail
Type: string Default: error.message
Error description.
instance
Type: urlString Default: undefined
URI identifying the value which errored.
stack
Type: string Default: error.stack
Error stack trace. Can be set to an empty string.
extra
Type: object Default: any additional error properties