Fix return types of async APIs#191
Merged
sophokles73 merged 1 commit intoeclipse-uprotocol:mainfrom Sep 5, 2025
Merged
Conversation
The operations of the L1, L2 and L3 APIs have all been returning CompletableFuture<UStatus> and had always been succeeded with a UStatus. Client code then had to check if the UCode was OK or not. This has been changed so that the operations now return CompletableFuture<Void> and complete normally if the operation was successful. If the operation failed, the future completes exceptionally with a UStatusException containing the UStatus with the error code. This is much more aligned with the way async operations are usually handled in Java and makes client code much cleaner.
|
Code coverage report is ready! 📈
|
PLeVasseur
approved these changes
Sep 4, 2025
PLeVasseur
left a comment
There was a problem hiding this comment.
Thanks Kai. I haven't read the details, but conceptually cleaner makes sense to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The operations of the L1, L2 and L3 APIs have all been returning CompletableFuture
and had always been succeeded with a UStatus. Client code then had to check if the UCode was
OK or not. This has been changed so that the operations now return CompletableFuture
and complete normally if the operation was successful. If the operation failed, the future
completes exceptionally with a UStatusException containing the UStatus with the error code.
This is much more aligned with the way async operations are usually handled in Java
and makes client code much cleaner.