Details
-
Type:
Feature Request
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 3.0.0.Beta1
-
Component/s: Core
-
Labels:None
-
Estimated Difficulty:Low
Description
The BeanManagerAware#getBeanManager() method currently throws an IllegalArgumentException when the BeanManager cannot be found by any provider. Because this exception is so generic, it's dangerous to bundle the lookup with other code because you aren't sure whether the IllegalArgumentException came from the BeanManager lookup or from a subsequent call, as in:
try
{ BeanManager beanManager = BeanManagerAccessor.getBeanManager(); beanManager.fireEvent(payload); }catch (IllegalArgumentException e)
{ // what caused this? }Introduce a specialized checked exception for this unique failure. The proposed name is BeanManagerNotAvailable (or BeanManagerNotFound)
I don't think that this should be a checked exception, as IMHO in most cases this is not recoverable. I am in favour of a BeanManagerNotAvailible unchecked exception