emberjs/ember.js — pull request #3940 by sandstrom (2013-12-15 21:01:14+00:00)
Title: Remove `Ember.handleErrors`

I see two benefits with this:
1. All error handling is kept in one place.
2. We avoid double-reporting of errors in case the error handler rethrows the error.

**Ember.handleErrors**
`Ember.handleErrors` catches errors and pass them to `Ember.onerrror`. It is used in two places, both in the `EventDispatcher`.

1. https://github.com/emberjs/ember.js/blob/3070328313b/packages/ember-views/lib/system/event_dispatcher.js#L145
2. https://github.com/emberjs/ember.js/blob/3070328313b/packages/ember-views/lib/system/event_dispatcher.js#L164

**Ember.run**
`Ember.run` catches errors and pass them to `Ember.onerrror`. I.e. it does the same thing in terms of error handling.

https://github.com/emberjs/ember.js/blob/0fcc6f8d23615/packages/ember-metal/lib/run_loop.js#L54

**This PR**
This pull request removes `Ember.handleErrors`. Errors occurring within event handlers will still be caught, but by `Ember.run`. All code-paths end up wrapped in `Ember.run`, but they are somewhat further down the call-chain (i.e. if there are errors in say `_findNearestEventManager` they will not be caught).

*See this issue for preceding discussion:* https://github.com/emberjs/ember.js/issues/3848