Concepts

The library models the application/problem+json payload defined in RFC 7807.

Standard fields

type (string)

A URI reference (RFC 3986) that identifies the problem type.

title (string)

A short, human-readable summary of the problem type. The library defaults to the description of the HTTP status code.

status (number)

The HTTP status code (RFC 7231, Section 6).

detail (string)

A human-readable explanation specific to this occurrence of the problem. The library returns the detail described by the ProblemCode.

instance (string)

A URI reference that identifies the specific occurrence of the problem.

Conta extensions

In addition to the RFC 7807 fields, the library defines:

code (string)

An application-level error code carried alongside the HTTP status (e.g. PET-2000). See Defining Problem Codes for how to define them.

level (enum)

Problem severity — one of Info, Warning, Error or Fatal.

info (map)

Extra context about the specific occurrence (e.g. the offending input, the missing identifier).

trace (object)

Tracing information (traceId, spanId) used to correlate the problem with logs and traces.