code: function errorHandler(err, req, res, next) {
    req.error = err;
    const errorHandlers = Route.routes('handler').filter((obj) => {
      return obj.target === req.url;
    });
  
    if(errorHandlers.length > 0) {
      return redirect(errorHandlers[0], req, res, next);
    }
  
  
    const errorRoute = Route.routes('err').filter((obj) => {
      return obj.extra.status === 500;
    });
  
    if(isDebug) {
      console.log(err.message);
    }
  
    if(errorRoute.length > 0) {
      return redirect(errorRoute[0], req, res, next, err);
    } else {
      app.set('view engine', 'ejs');
      res.status(500).render(`${__dirname}/src/assets/errors.ejs`, {
        status: 500,
        message: err.message
      });
    }
  }
docs: Error handler
  @param err
  @param req
  @param res
  @param next