Download backend/src/middleware/errorHandler.js from Shiva7706/BlueFin: direct link, hf CLI and curl.
- Browser
- Download file 350 Bytes
-
https://huggingface.co/spaces/Shiva7706/BlueFin/resolve/main/backend/src/middleware/errorHandler.js
- Command line
-
hf download hf://spaces/Shiva7706/BlueFin/backend/src/middleware/errorHandler.js
-
curl -L -o errorHandler.js https://huggingface.co/spaces/Shiva7706/BlueFin/resolve/main/backend/src/middleware/errorHandler.js
350 Bytes
| export default async function errorHandler(c, next) { | |
| try { | |
| await next(); | |
| } catch (err) { | |
| const ts = new Date().toISOString(); | |
| const path = c.req.path; | |
| console.error(`[${ts}] Unhandled error at ${path}:`, err); | |
| return c.json( | |
| { error: err.message || "Internal server error", status: 500, path }, | |
| 500, | |
| ); | |
| } | |
| } | |