Spaces:
Sleeping
Sleeping
Download utils/catchAsync.js from Mahmoud7456/MultiUsersSalesSystem: direct link, hf CLI and curl.
- Browser
- Download file 271 Bytes
-
https://huggingface.co/spaces/Mahmoud7456/MultiUsersSalesSystem/resolve/main/utils/catchAsync.js
- Command line
-
hf download hf://spaces/Mahmoud7456/MultiUsersSalesSystem/utils/catchAsync.js
-
curl -L -o catchAsync.js https://huggingface.co/spaces/Mahmoud7456/MultiUsersSalesSystem/resolve/main/utils/catchAsync.js
271 Bytes
| /** | |
| * Error handling wrapper for async route handlers | |
| * Catches errors and passes them to Express error middleware | |
| */ | |
| export const catchAsync = (fn) => { | |
| return (req, res, next) => { | |
| fn(req, res, next).catch(next); | |
| }; | |
| }; | |
| export default catchAsync; | |