Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. module.exports = function (fn) {
  2. return async function(req, res, next) {
  3. try{
  4. await fn(req, res, next);
  5. }catch(error){
  6. console.log('Error happened' + error);
  7. res.status(500).send('Unexpected Error');
  8. }finally{
  9. }
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement