MCPcopy Create free account
hub / github.com/Lakr233/AssppWeb / errorHandler

Function errorHandler

backend/src/middleware/errorHandler.ts:3–11  ·  view source on GitHub ↗
(
  err: Error,
  req: Request,
  res: Response,
  next: NextFunction,
)

Source from the content-addressed store, hash-verified

1import { Request, Response, NextFunction } from "express";
2
3export function errorHandler(
4 err: Error,
5 req: Request,
6 res: Response,
7 next: NextFunction,
8) {
9 console.error("Error:", err.message);
10 res.status(500).json({ error: "Internal server error" });
11}

Callers

nothing calls this directly

Calls 1

jsonMethod · 0.80

Tested by

no test coverage detected