NatsRequestCompletableFuture throws CancellationException instead of TimeoutException on timeout #797
ajax-semenov-y
started this conversation in
General
Replies: 2 comments 3 replies
-
@ajax-semenov-y |
Beta Was this translation helpful? Give feedback.
0 replies
-
@ajax-semenov-y Actually... If I throw a Timeout exception instead you end up getting an ExecutionException which has a TimeoutException as it's cause. I don't think this is any better. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I just noticed that
public CompletableFuture<Message> requestWithTimeout(String subject, byte[] body, Duration timeout)
throwsCancellationException
when the timeout is exceeded. This code is located inNatsRequestCompletableFuture
As for me, the more common exception for this case is
TimeoutException
. Is it possible to changeCancellationException
toTimeoutException
?Beta Was this translation helpful? Give feedback.
All reactions