UNPKG

error-response-handler

Version:

Comprehensive error handling and response formatting for Node.js applications

16 lines (15 loc) 509 B
import { ErrorResponse, StatusInput } from "./types"; export declare class AppError extends Error { readonly statusCode: number; readonly statusText: string; readonly isOperational: boolean; readonly timestamp: string; constructor(message: string, status?: StatusInput, isOperational?: boolean); } export declare const errorResponse: (options: { message?: string; error?: unknown; statusCode?: StatusInput; includeStack?: boolean; isDev?: boolean; }) => ErrorResponse;