Backend: Implement async error handling wrapper and refactor entry and media controllers to use it

This commit is contained in:
X4Lo committed 2026-03-30 17:25:46 +01:00
1 parent ad58164df4
commit 4a1d2bc614
8 files changed
+92 -33

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
// Async wrapper utility to catch async errors and pass them to Express error handler
const asyncWrapper = (fn) => {
return (req, res, next) => {
Promise.resolve(fn(req, res, next)).catch(next);
};
};
module.exports = asyncWrapper;