Spaces:
Paused
Paused
Download utilities/catchAsyncError.js from arabdullah/chatty: direct link, hf CLI and curl.
- Browser
- Download file 192 Bytes
-
https://huggingface.co/spaces/arabdullah/chatty/resolve/main/utilities/catchAsyncError.js
- Command line
-
hf download hf://spaces/arabdullah/chatty/utilities/catchAsyncError.js
-
curl -L -o catchAsyncError.js https://huggingface.co/spaces/arabdullah/chatty/resolve/main/utilities/catchAsyncError.js
192 Bytes
| const ReqError = require("./ReqError"); | |
| module.exports = function (fn) { | |
| return function (req, res, next) { | |
| fn(req, res, next).catch((error) => next(new ReqError(400, error))); | |
| }; | |
| }; | |