MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / onGetError

Function onGetError

apps/web/server/middlewares/error.ts:26–32  ·  view source on GitHub ↗
(error: any, req: any, res: any, _: any)

Source from the content-addressed store, hash-verified

24}
25
26export function onGetError(error: any, req: any, res: any, _: any) {
27 const path = !!req.baseUrl ? req.baseUrl : req.url;
28 console.error(
29 `[${req.method}] ${path} >> StatusCode:: 500, Message:: ${error.message}`
30 );
31 return res.redirect('/500');
32}
33
34export function onNoMatch(req: any, res: any) {
35 res.status(404).json({ message: 'Not Found' });

Callers

nothing calls this directly

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected