Skip to content
New issue

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

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

Already on GitHub? # to your account

Better handling of syncronous exceptions #83

Closed
wants to merge 1 commit into from
Closed

Better handling of syncronous exceptions #83

wants to merge 1 commit into from

Conversation

ForbesLindesay
Copy link
Contributor

This forces all errors thrown by consolidate.js to be asynchronous and passed to the callback properly. This simplifies the API usage since it means that:

  1. Errors are always guaranteed to be observable (unlike when fromStringRenderer is used in the current implementation).
  2. You only have to handle errors in one place because you know they will always be passed to the callback.

We also ensure that we only call the callback once. By wrapping error handling up in a helper method, the code is also a little bit cleaner.

@tj
Copy link
Owner

tj commented Jan 7, 2013

hmm the diff is crazy, needs a rebase i think

@ForbesLindesay
Copy link
Contributor Author

Hmm, yes, I've resubmitted with a better diff. Most of the libraries have been changed though, so the diff is pretty huge (but it's not 'dump everything and start again')

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

Successfully merging this pull request may close these issues.

2 participants