forked from jappel/leistungsbilanz-ts
first commit
This commit is contained in:
commit
c3e98af5b6
36 changed files with 4779 additions and 0 deletions
12
src/server/middleware/error.middleware.ts
Normal file
12
src/server/middleware/error.middleware.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import type { NextFunction, Request, Response } from "express";
|
||||
|
||||
export function errorMiddleware(
|
||||
error: unknown,
|
||||
_req: Request,
|
||||
res: Response,
|
||||
_next: NextFunction
|
||||
) {
|
||||
console.error(error);
|
||||
res.status(500).json({ error: "Internal Server Error" });
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue