@sandsoftwaresolutions/problem-details
v0.1.0
Published
Small RFC 9457 Problem Details helpers for JSON APIs.
Maintainers
Readme
@sandsoftwaresolutions/problem-details
Small, dependency-free helpers for RFC 9457 Problem Details JSON errors.
npm install @sandsoftwaresolutions/problem-detailsimport { problemResponse } from "@sandsoftwaresolutions/problem-details";
return problemResponse({ status: 422, detail: "Validation failed", errors: { email: "Invalid address" } });createProblem creates a consistent error payload; problemResponse returns a fetch-compatible response with application/problem+json; ProblemDetailsError lets application code intentionally throw a public API error; fromError converts unknown failures to a safe generic 500 without leaking internals.
