@fajarnugraha37/error
Version:
Runtime-agnostic error handling library with structured errors, adapters, and validation support for Bun, Node.js, and browsers
17 lines (14 loc) • 546 B
TypeScript
import { AppError } from './app-error.js';
interface ProblemDetails {
type?: string;
title: string;
status?: number;
detail?: string;
instance?: string;
[key: string]: unknown;
}
declare function toProblem(err: AppError): ProblemDetails;
declare function fromProblem(problem: ProblemDetails): AppError;
declare function toProblemJSON(err: AppError, space?: number): string;
declare function fromProblemJSON(json: string): AppError;
export { type ProblemDetails, fromProblem, fromProblemJSON, toProblem, toProblemJSON };