code: function catchClientError(req, res, next) {
    const { end } = res;
  
    res.end = function() {
      // console.log(`Catch client response : ${req.url} ${res.statusCode}`);
      const errorRoute = Route
        .routes('err')
        .filter((obj) => {
          return obj.extra.status === res.statusCode && obj.route !== req.url;
        });
  
      if(errorRoute.length > 0 && !isRedirect) {
        return redirect(errorRoute[0], req, res, next);
      }
  
      isRedirect = false;
      end.apply(res, arguments);
    };
  
    next();
  }
docs: Catch client response for redirect to error
  @param req
  @param res
  @param next