type is about:blank for problems whose only semantics are their status
code, and the framework validation problem type when the error carries an
errors extension. Every other member is assembled identically to the
deprecated RFC 7807 formatter.
Param: error
The thrown error to format
Param: ctx
Optional request context (used for instance)
Returns
An RFC 9457 Problem Details body
Example
rfc9457Formatter(notFound('User 42 does not exist'), ctx); // { // type: 'about:blank', // title: 'Not Found', // status: 404, // detail: 'User 42 does not exist', // instance: '/users/42', // }
Format an error as RFC 9457 Problem Details.
typeisabout:blankfor problems whose only semantics are their status code, and the framework validation problem type when the error carries anerrorsextension. Every other member is assembled identically to the deprecated RFC 7807 formatter.