frjaeger220 / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Should OutOfScopeException extend ProvisionException? #299

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We should specify what the caller needs to catch when Provider.get() is called 
when the provider is 
out of scope.

Original issue reported on code.google.com by limpbizkit on 31 Dec 2008 at 7:15

GoogleCodeExporter commented 9 years ago
Need to resolve this before freezing the 2.0 API.

Original comment by gili.tza...@gmail.com on 28 Jan 2009 at 3:26

GoogleCodeExporter commented 9 years ago
This should not be a recoverable exception as it represents programmer error. 
OutOfScopeException should not 
be public.

Otherwise we're effectively creating two tiers of scoping.

Original comment by dha...@gmail.com on 28 Jan 2009 at 4:21

GoogleCodeExporter commented 9 years ago
It's potentially handy to have it for folks writing their own scopes. But we 
definitely shouldn't recommend people 
catch the thing, especially since it's a ProvisionException that'll ultimately 
get thrown, since Guice always wraps 
the Exception thrown by Providers, @Provides methods, and injections in a 
ProvisionException.

Perhaps I'll update the doc on the exception to mention that.

Gili, thanks for paying attention to this.

Original comment by limpbizkit on 28 Jan 2009 at 4:33

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 26 Apr 2009 at 9:44

GoogleCodeExporter commented 9 years ago
Make it public, but I would suggest not deriving ProvisionException.

Original comment by dha...@gmail.com on 27 Apr 2009 at 10:50

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 16 May 2009 at 7:36

GoogleCodeExporter commented 9 years ago
Since it always gets wrapped, maybe Provider.get shouldn't say that it throws 
it.

Original comment by net...@gmail.com on 15 Jul 2009 at 5:52