<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">My understanding ( and I may be way off here… ) <div><br></div><div>The “feature” provided by exceptions et al has been around in various languages for a long time, pre-Java, so the term had a level of familiarity when Java came out. Java’s approach however of having different “types” of exception encoded in the type system led the class hierarchy with a common base class Throwable. There’s checked and unchecked Exceptions, which extend the Exception class which extends Throwable. But then we also have Error which extends Throwable but is the base of a second hierarchy representing “bad things” that are not intended to be caught… So we can think of Exceptions as things that are throwable and may be caught within application code.</div><div><br></div><div>It remains an open question whether the idea of checked/unchecked exceptions is good or not - and many strong opinions can be found on this topic so I don’t need to say any more :) </div><div><br></div><div>Hope that makes sense :)</div><div><br></div><div>George</div><div><br id="lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 1 Aug 2025, at 12:51, David Alayachew <davidalayachew@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="auto">Thanks for the responses everyone. It appears that there are several examples that return too. Sounds like the reason is convention then.<div dir="auto"><div dir="auto"><br></div><div dir="auto">I guess a better question might be, why were all these API's named with Exception rather than Throwable in the first place? What benefit is there in naming it Exception?</div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Aug 1, 2025, 4:47 AM Remi Forax <<a href="mailto:forax@univ-mlv.fr">forax@univ-mlv.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><div><br></div><div><br></div><hr id="m_-790280557419120909zwchr"><div><blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt;"><b>From: </b>"Alan Bateman" <<a href="mailto:alan.bateman@oracle.com" target="_blank" rel="noreferrer">alan.bateman@oracle.com</a>><br><b>To: </b>"David Alayachew" <<a href="mailto:davidalayachew@gmail.com" target="_blank" rel="noreferrer">davidalayachew@gmail.com</a>>, "loom-dev" <<a href="mailto:loom-dev@openjdk.org" target="_blank" rel="noreferrer">loom-dev@openjdk.org</a>><br><b>Sent: </b>Friday, August 1, 2025 10:28:04 AM<br><b>Subject: </b>Re: Bikeshedding Structured Concurrency<br></blockquote></div><div><blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt;"><div>On 01/08/2025 06:05, David Alayachew
wrote:<br>
</div>
<blockquote>
<div dir="ltr">
<div class="gmail_default" style="font-family:monospace">Hello <a class="gmail_plusreply" id="m_-790280557419120909plusReplyChip-0" href="mailto:loom-dev@openjdk.org" target="_blank" rel="noreferrer">@loom-dev</a>,</div>
<div class="gmail_default" style="font-family:monospace"><br>
</div>
<div class="gmail_default" style="font-family:monospace">I have
been enjoying the Structured Concurrency JEP's as they have
come, and I am excited to try the JDK 25 variant with all the
new changes with Joiner.</div>
<div class="gmail_default" style="font-family:monospace"><br>
</div>
<div class="gmail_default" style="font-family:monospace">I have
a bikeshed request.</div>
<div class="gmail_default" style="font-family:monospace"><br>
</div>
<div class="gmail_default" style="font-family:monospace">For
Subtask, can we change the method name from exception() to
throwable()? It more accurately describes what is happening.</div>
<br>
</div>
</blockquote>
<br>
In j.u.concurrent there is
CompletableFuture.completeExceptionally(Throwable)/obtrudeException(Throwable),
SubmissionPublisher.closeExceptionally(Throwable),
ForkJoinTask.getException and Future.exceptionNow() returning a
Throwable, and a few more.</blockquote><div><br></div><div>yes, also Future.exceptionNow().</div><div><br></div><blockquote style="border-left-width: 2px; border-left-style: solid; border-left-color: rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica, Arial, sans-serif; font-size: 12pt;"><br>
<br>
The main use of Subtask::exception will be a custom Joiner's
onComplete implementation where handles the exception or error when
the subtask fails. There is an argument that fork should be void or
just return a Supplier (Subtask extends Supplier) but there hasn't
been enough feedback from real-world usage to help that discussion.<br>
<br>
-Alan<br></blockquote><div><br></div><div>Rémi</div><div><br></div></div></div></div></blockquote></div>
</div></blockquote></div><br></div></body></html>