Function: toProblem()
toProblem(
error,correlationId?):ProblemDetails
Defined in: packages/common/src/problem.ts:361
Maps anything thrown to the problem to send.
- A ProblemError passes through.
- An error carrying a numeric HTTP
status(Nest'sHttpExceptionexposesgetStatus()) is mapped by class of status, with no detail: framework messages can echo input. 401, 403, 404 and 413 keep their kind; other 4xx becomevalidation; 5xx becomeinternal. - Everything else is
internal.
Note 403 from a framework guard maps to forbidden; resource-scoped refusals
must throw problems.notFound themselves, which only the service can know.
Parameters
error
unknown
correlationId?
string