Replies: 1 comment 2 replies
-
Returning a failed You might also look at https://smallrye.io/smallrye-mutiny/2.5.3/guides/joining-unis/ and the fail-fast option. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Kotlin and Quarkus to building restful api , I wanna know how to interrupt the chain operation when there is some error.
say we have code below:
the code is for demostration. Here I have three async operation , and I wanna check if any of the results is "invalid string", if any I'd prefer stop the chain operaion immediately and return the HttpResponse to frontend(return at the OnFailure method and no more further operation).if there is not, then pass the list of results to the further operation.
the docs says we could create failed Uni instances with
Uni.createFrom().failure(new Exception("boom"))
, could I just throw a runtimeExcepition?is the code above the right way to handle the error in Mutiny?
Beta Was this translation helpful? Give feedback.
All reactions