trapx
Version:
A plug-and-play middleware for standardized error handling in TypeScript-based Express.js applications
9 lines (8 loc) • 364 B
TypeScript
import { ErrorRequestHandler } from 'express';
import { BaseError } from '../errors/BaseError';
export interface ErrorHandlerOptions {
includeStackTrace?: boolean;
logError?: (error: Error) => void;
transformError?: (error: Error) => Partial<BaseError>;
}
export declare function createErrorHandler(options?: ErrorHandlerOptions): ErrorRequestHandler;