Why would provider.get(...) throw though?  Either:
a) there is an error that takes down the entire application and leaving the
injector in an inconsistent state is not a problem.
b) the error is being caught somewhere and your app contains a terrible
performance bug. (e.g. 1000x slower than it should be)

Both cases are bad, so we should not support providers that throw.


On Mon, Apr 14, 2014 at 10:58 AM, Pavel Jbanov <notifications@github.com>wrote:

> In lib/injector.dart:
>
> > @@ -109,14 +109,9 @@ class Injector {
> >      }
> >
> >      var value;
> > -    try {
> > -      resolving.add(key);
> > -      value = provider.get(this, requester, _getInstanceByKey, _error);
> > -      resolving.removeLast();
> > -    } catch(e) {
> > -      resolving.clear();
>
> I'm afraid this try-catch is absolutely necessary, otherwise it might
> leave your injectors in an inconsistent state.
>
> For example, if the provider.get(...) throws, resolving.removeLast() will
> not happen, so next time injector.get() is called it might result in a
> "circular dependency" error (because resolving would not be correctly
> cleaned up).
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/angular/di.dart/pull/84/files#r11598415>
> .
>