UNPKG

honestjs

Version:

HonestJS - a modern web framework built on top of Hono

29 lines (28 loc) 1.29 kB
import type { Context } from 'hono'; /** * Handler for managing application-wide error responses * Provides a consistent way to handle and format error responses across the application */ export declare class ErrorHandler { /** * Creates a middleware function that handles error responses * @returns A middleware function that formats and returns error responses using createErrorResponse */ static handle(): (err: Error, c: Context) => Promise<Response & import("hono").TypedResponse<{ status: number; message: string; timestamp: string; path: string; requestId?: string | undefined; code?: string | undefined; details?: { [x: string]: any; } | undefined; errors?: { property: string; constraints: { [x: string]: string; }; }[] | undefined; }, 100 | 102 | 103 | 200 | 201 | 202 | 203 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 305 | 306 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 | -1, "json">>; }