Skip to content

How to avoid 'Mutiny had to drop the following exception' #1288

Answered by jponge
ennishol asked this question in Q&A
Discussion options

You must be logged in to vote

UniJoinFirst actually cancels the remaining Uni instances when the first one emits an item.

What you are seeing here is actually normal, the upstream Uni is running (blocking) code in getValue. So ultimately an exception is thrown after cancellation, and this is still being reported because creating from an item should not throw, and because the code in getValue has no way to cancel (Mutiny cannot automagically cancel code).

If you want to run some code that can either emit an item or report an exception, you might use Uni.createFrom().emitter(...).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jponge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1287 on May 24, 2023 08:37.