10 lines
571 B
TypeScript
10 lines
571 B
TypeScript
/**
|
|
* Centralized Express error handler — production-safe messages and consistent status codes.
|
|
*/
|
|
import { Request, Response, NextFunction } from 'express';
|
|
/**
|
|
* Wraps an async route handler so rejections reach the global error middleware.
|
|
*/
|
|
export declare function asyncHandler(fn: (req: Request, res: Response, next: NextFunction) => Promise<void>): (req: Request, res: Response, next: NextFunction) => void;
|
|
export declare function errorHandler(err: unknown, _req: Request, res: Response, _next: NextFunction): void;
|
|
//# sourceMappingURL=errorHandler.d.ts.map
|