This commit is contained in:
2026-10-01 11:52:17 +05:30
commit d303c576fd
26 changed files with 3229 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
function httpError(status, message) {
const err = new Error(message);
err.status = status;
return err;
}
function asyncHandler(fn) {
return (req, res, next) => {
Promise.resolve(fn(req, res, next)).catch(next);
};
}
module.exports = { httpError, asyncHandler };