Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must be to Error handler #14

Open
devalexqt opened this issue Jan 20, 2019 · 1 comment
Open

Must be to Error handler #14

devalexqt opened this issue Jan 20, 2019 · 1 comment

Comments

@devalexqt
Copy link

In my scenario if html-minify has error then whole server is down! I think, that html-minify must be in try{...}catch(err){...} to prevent server down, and if err then return original html;

this code:
` var sendMinified = function (callback) {

  // No callback specified, just minify and send to client.
    if (typeof callback === 'undefined') {
      return function (err, html) {
        if (err) {
          return next(err);
        }

        html = minify(html, opts.htmlMinifier);<<<<<<<--------------  what if error occur???
        res.send(html);
      }
    } else {

      // Custom callback specified by user, use that one
      return function (err, html) {
        if (html) {
          html = minify(html, opts.htmlMinifier);<<<<<<<---------------  what if error occur???
        }

        callback(err, html);
      }
    }
};`
@meszaros-lajos-gyorgy
Copy link

This is fixed by #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants