Send meaningful io.grpc.Status.Code to gRPC clients [No. 2] #6088
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.
Exceptions thrown by the Core API services up to the daemon's Grpc*Services have to be converted into gRPC
StatusRuntimeException
s before being sent to gRPC clients. Most of these gRPCStatusRuntimeException
s had a gRPCStatus.Code.UNKNOWN
, which not helpful to client error handlers.This change partially resolves the issue by sending more meaningful gRPC response status codes to clients, where possible. But it is not as comprehensive as it can be for a webapp because HTTP has so many more possible response status codes than the gRPC library (sixteen). See: https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/Status.java
There are three types of changes:
Create custom exceptions in
bisq.core.api.exception
.Map any custom
bisq.core.api.exception
to a meaningfulio.grpc.Status.Code
within daemon Grpc*Service classes.Adjust apitest cases to new grpc status codes.
Based on branch
move-cli-crypto-offer-filter-to-server
, PR #6086