-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
3.1.9.Final, 4.0.3.Final, 5.0.0.CR2
-
None
If an event is fired (and observed) asynchronously, the returned CompletionStage behaves differently in the case of exceptions depending on the number of observers that threw exceptions: If only one observer throws, the exception is directly put into the CompletionStage, if more than one observer throws, the exceptions are first composed into a CompletionException and that is put into the CompletionStage.
This violates the CDI Spec, 10.5.1 or at least my reading of the spec. Since the programmer cannot know how many observer methods have thrown exceptions (in general, one does not even know how many there are), the exceptions should be accessed in a uniform way, no matter how many there are, i.e. they should always be treated as if there are more than one.