Provides the Problem type for structured, machine-readable error information in HTTP responses
and a guarded createFetch wrapper with consistent promise semantics.
Problem Details
import { Problem } from"@metreeca/core/problem";
constproblem: Problem = { status:404, title:"Not Found", detail:"Resource /api/users/123 does not exist", instance:"/api/users/123", report: { timestamp:"2025-12-02T10:30:00Z" } };
try { constresponse = awaitguard("https://api.example.com/data"); // response.ok is guaranteed true } catch (problem) { // problem is a Problem with parsed error details console.error(problem.status, problem.detail, problem.report); }
RFC 9457 problem details for HTTP APIs.
Provides the Problem type for structured, machine-readable error information in HTTP responses and a guarded createFetch wrapper with consistent promise semantics.
Problem Details
Guarded Fetch
See
RFC 9457 - Problem Details for HTTP APIs