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

Fix double handling of exceptions #2312

Merged
merged 1 commit into from
Nov 26, 2014
Merged

Fix double handling of exceptions #2312

merged 1 commit into from
Nov 26, 2014

Conversation

ForbesLindesay
Copy link
Contributor

This only effects the callback based code path. Consider code like:

less.render(str, options, function (err, res) {
  if (err) {
    console.log('error handler');
    return;
  }
  throw new Error('Ooops, I made a mistake');
});

In the case where less rendering succeeds. This should crash with the error "Ooops, I made a mistake" but instead it logs "error handler" and exists cleanly. This is because the initial error is incorrectly caught by the try catch block and given back to the callback.

This pull request fixes the bug.

@lukeapage
Copy link
Member

Thanks.. will release a patch release soon.

lukeapage added a commit that referenced this pull request Nov 26, 2014
@lukeapage lukeapage merged commit 5173186 into less:master Nov 26, 2014
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

Successfully merging this pull request may close these issues.

2 participants