<div dir="ltr">Good question Martin,<div><br></div><div>We added the FireAsyncException because users don&#39;t have hook on the pipeline created internally by the vent dispatcher. If you call hand or whenComplete on the completionStage returned by fireAsync() you&#39;ll get the FireAsyncException.</div><div>If you choose to continue the pipeline without checking the outcome of fireAsync you&#39;ll get the <span style="font-size:13.1999998092651px;line-height:19.7999992370605px">CompletionException wrapping the FireAsyncException.</span></div><div><br></div><div>Now if you have suggestion to handle this differently, your input is welcome. The EDR is here for that ;).</div><div><br></div><div>Antoine</div><br><div class="gmail_quote"><div dir="ltr">Le lun. 13 juil. 2015 à 13:04, Martin Kouba &lt;<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a>&gt; a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
the CDI 2.0 EDR1, &quot;10.5.1. Handling multiple exceptions thrown during an<br>
asynchronous event&quot; currently states:<br>
<br>
&quot;If an event is asynchronous, and an exception is thrown by any of its<br>
notified observers, the CompletionStage returned by fireAsync will<br>
complete exceptionally with FireAsyncException exception.&quot;<br>
<br>
And there&#39;s also an example of handle() method with lambda which gets<br>
FireAsyncException passed as an param. This looks good from the user<br>
point of view.<br>
<br>
However, what should happen if I use e.g. thenAccept() method? The<br>
CompletionStage API is clear:<br>
&quot;Two method forms support processing whether the triggering... In all<br>
other cases, if a stage&#39;s computation terminates abruptly with an<br>
(unchecked) exception or error, then all dependent stages requiring its<br>
completion complete exceptionally as well, with a CompletionException<br>
holding the exception as its cause...&quot;. In other words,<br>
myEvent.fireAsync(...).thenAccept(...).exceptionally(...) should receive<br>
CompletionException and not FireAsyncException.<br>
<br>
This seems a bit inconsistent to me. Am I missing something?<br>
<br>
--<br>
Martin Kouba<br>
Software Engineer<br>
Red Hat, Czech Republic<br>
_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org" target="_blank">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
</blockquote></div></div>