Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function (fn) {
- return async function(req, res, next) {
- try{
- await fn(req, res, next);
- }catch(error){
- console.log('Error happened' + error);
- res.status(500).send('Unexpected Error');
- }finally{
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement