On 10/29/26 16:34, MG wrote:
Hi blackdrag*,

would something like the following work, assuming an exception inside the async block would be wrapped in an AsyncWrapperException by Groovy:

for await (value in channel) try {
      println value
}
catch(AsyncWrapperException ae) {
     ...
}
catch(Throwable t) {
     ...
}

That works if getting the value throws the exception, which is actually the case. The problem is that channel does not know about the exception in the async block, unless you tell the channel. But that would make the example look ugly and it would still work, till there is an exception.

bye Jochen

Reply via email to