mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
10 lines
205 B
JavaScript
10 lines
205 B
JavaScript
const asyncMiddleware = (fn) => (req, res, next) => {
|
|
Promise.resolve(fn(req, res, next))
|
|
.catch((error) => {
|
|
console.log(error);
|
|
next(error);
|
|
});
|
|
};
|
|
|
|
export default asyncMiddleware;
|