X-Received: by 10.236.199.108 with SMTP id w72mr6080002yhn.31.1409080727446; Tue, 26 Aug 2014 12:18:47 -0700 (PDT) X-Received: by 10.140.100.182 with SMTP id s51mr38669qge.29.1409080727394; Tue, 26 Aug 2014 12:18:47 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!i13no3373886qae.1!news-out.google.com!j6ni8038qas.0!nntp.google.com!m5no3372370qaj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Tue, 26 Aug 2014 12:18:47 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=82.84.148.123; posting-account=3UI3NAoAAAAjL2XRP478u99EI52dPE_y NNTP-Posting-Host: 82.84.148.123 References: <2e594246-2475-4b45-ae5e-2624b9a843d1@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2600676e-aa05-41fa-9540-e3a1f83ea600@googlegroups.com> Subject: Re: Exception Handling in Asynchronous Java Code From: dario.crivelli@lightstreamer.com Injection-Date: Tue, 26 Aug 2014 19:18:47 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:29861 Hi Sebastian, my colleague Valerio informed me of your suggestion. I acknowledge that CompletableFuture offers a management of exceptions that is more powerful than the native support provided by the Java syntax. However, it views exceptions as some sort of showstoppers, not as special conditions each of which may deserve a different treatment. In fact, it does not allow you to selectively handling some types of exceptions while keeping others for further steps: you can only handle all types of possible exceptions in the same step, perhaps to log an error at the end of the processing. This seems to be by design; I don't know the story behind, but I wonder why there is a method CompletableFuture exceptionally(Function fn); but not something like CompletableFuture exceptionally(Function> fn); Am I missing something?