UNPKG

hono-ban

Version:

HTTP-friendly error objects for Hono, inspired by Boom

20 lines (19 loc) 738 B
/** * Default error formatter implementation * @module hono-ban/formatters/default */ import type { BanError, DefaultErrorOutput, Headers } from "../../types"; /** * Default JSON formatter with a clean, flat structure */ export declare const defaultFormatter: { contentType: string; /** * Format an error into a standardized output structure * @param error - Error to format * @param headers - Headers for HTTP response (not included in response body) * @param sanitize - Fields to remove from output * @param includeStackTrace - Whether to include stack traces */ format(error: BanError, headers?: Headers, sanitize?: readonly string[], includeStackTrace?: boolean): DefaultErrorOutput; };