Skip to content

Must be to Error handler #14

@devalexqt

Description

@devalexqt

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);
      }
    }
};`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions