add project
This commit is contained in:
6
apps/api/src/middleware/error-handler.ts
Normal file
6
apps/api/src/middleware/error-handler.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
|
||||
export function errorHandler(err: Error, _req: Request, res: Response, _next: NextFunction): void {
|
||||
console.error('[ERROR]', err.message);
|
||||
res.status(500).json({ success: false, error: 'Internal server error' });
|
||||
}
|
||||
Reference in New Issue
Block a user