ApiExceptions: Wrap streaming errors in ApiExceptions.#445
ApiExceptions: Wrap streaming errors in ApiExceptions.#445garrettjonesgoogle merged 2 commits intogoogleapis:masterfrom
Conversation
This changes current behavior in non-backward compatible ways.
Codecov Report
@@ Coverage Diff @@
## master #445 +/- ##
==========================================
+ Coverage 69.44% 70% +0.55%
- Complexity 663 679 +16
==========================================
Files 143 148 +5
Lines 3067 3124 +57
Branches 232 232
==========================================
+ Hits 2130 2187 +57
Misses 848 848
Partials 89 89
Continue to review full report at Codecov.
|
|
|
||
| /** | ||
| * Core logic for transforming GRPC exceptions into {@link ApiException}s. This logic is shared | ||
| * amongst all of the call types |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| * | ||
| * @param <ResponseT> | ||
| */ | ||
| final class GrpcApiExceptionResponseObserver<ResponseT> implements ApiStreamObserver<ResponseT> { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| callable, grpcCallSettings.getParamsExtractor()); | ||
| } | ||
| callable = | ||
| new GrpcExceptionServerStreamingCallable<>(callable, ImmutableSet.<StatusCode.Code>of()); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@pongad PTAL |
| } | ||
|
|
||
| private class ExceptionResponseObserver implements ResponseObserver<ResponseT> { | ||
| private ResponseObserver<ResponseT> innerObserver; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
LGTM |
|
@garretjonesgoogle, let me know if there is anything else that needs to be polished here. If not, please merge |
note: This changes current behavior in non-backward compatible ways.
This adds exception wrapping for all streaming rpcs (client, server & bidi).
This should address #383 and googleapis/google-cloud-java#2671