Variable: problems
constproblems:object
Defined in: packages/common/src/problem.ts:241
Factories, one per kind. Each returns a ProblemError to throw, so the
call site reads throw problems.notFound().
Type Declaration
conflict
readonlyconflict: (options) =>ProblemError
409, a conflict. retryable: false (the module said so) means the same request
can never succeed, so the advice is to re-read and decide rather than to retry once.
Parameters
options?
ModuleProblemOptions & object = {}
Returns
forbidden
readonlyforbidden: (options) =>ProblemError
403, for an operation a role never permits. For a RESOURCE the caller may not see, use problems.notFound: the two must be indistinguishable.
Parameters
options?
ProblemOptions = {}
Returns
internal
readonlyinternal: (options) =>ProblemError
- Takes no
detail: nothing about our internals reaches the caller.
Parameters
options?
Pick<ProblemOptions, "correlationId" | "cause"> = {}
Returns
misdirectedRequest
readonlymisdirectedRequest: (options) =>ProblemError
- The request's
Hostis not one this service answers to. Raised before any handler, so it carries nothing about what the service is.
Parameters
options?
ModuleProblemOptions = {}
Returns
notFound
readonlynotFound: (options) =>ProblemError
- Deliberately takes no
detail: the response for "does not exist" and "exists but out of scope" is byte-identical in status, type, title and body shape (onlycorrelationIddiffers).
Parameters
options?
Pick<ProblemOptions, "correlationId" | "cause"> = {}
Returns
payloadTooLarge
readonlypayloadTooLarge: (options) =>ProblemError
- The body exceeded the service's limit; sending it again unchanged cannot work.
Parameters
options?
ProblemOptions = {}
Returns
state
readonlystate: (options) =>ProblemError
409, wrong moment.
Parameters
options?
ModuleProblemOptions = {}
Returns
tooManyRequests
readonlytooManyRequests: (options) =>ProblemError
- The caller has made more attempts than the service allows. The advice is to stop, not to retry with backoff: a service that answers this has usually decided something (a limit reached, a code burned) that waiting does not undo.
Parameters
options?
ModuleProblemOptions = {}
Returns
unauthenticated
readonlyunauthenticated: (options) =>ProblemError
Parameters
options?
ProblemOptions = {}
Returns
unavailable
readonlyunavailable: (options) =>ProblemError
Parameters
options?
ModuleProblemOptions & object = {}
Returns
unsupportedMediaType
readonlyunsupportedMediaType: (options) =>ProblemError
- The body's media type is not one this endpoint reads; sending it again unchanged cannot work.
Parameters
options?
ProblemOptions = {}
Returns
upstream
readonlyupstream: (options) =>ProblemError
detailshould say whose fault it is (the vendor, the ledger).
Parameters
options?
ModuleProblemOptions = {}
Returns
validation
readonlyvalidation: (errors,options) =>ProblemError
errorsnames fields and what is wrong, never the submitted values.
Parameters
errors?
readonly ProblemFieldError[] = []
options?
ModuleProblemOptions = {}