Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

ApiExceptions: Wrap streaming errors in ApiExceptions.#445

Merged
garrettjonesgoogle merged 2 commits intogoogleapis:masterfrom
igorbernstein2:ssc-6-exceptions
Dec 19, 2017
Merged

ApiExceptions: Wrap streaming errors in ApiExceptions.#445
garrettjonesgoogle merged 2 commits intogoogleapis:masterfrom
igorbernstein2:ssc-6-exceptions

Conversation

@igorbernstein2
Copy link
Contributor

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

This changes current behavior in non-backward compatible ways.
@codecov-io
Copy link

codecov-io commented Dec 14, 2017

Codecov Report

Merging #445 into master will increase coverage by 0.55%.
The diff coverage is 98.64%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ Complexity Δ
...a/com/google/api/gax/grpc/GrpcCallableFactory.java 72% <100%> (+3.81%) 7 <0> (ø) ⬇️
...m/google/api/gax/grpc/GrpcApiExceptionFactory.java 100% <100%> (ø) 6 <6> (?)
...x/grpc/GrpcExceptionTranslatingStreamObserver.java 100% <100%> (ø) 4 <4> (?)
...i/gax/grpc/GrpcExceptionBidiStreamingCallable.java 100% <100%> (ø) 2 <2> (?)
...gax/grpc/GrpcExceptionServerStreamingCallable.java 100% <100%> (ø) 2 <2> (?)
...gax/grpc/GrpcExceptionClientStreamingCallable.java 100% <100%> (ø) 2 <2> (?)
...com/google/api/gax/grpc/GrpcExceptionCallable.java 95.45% <66.66%> (-1.77%) 2 <0> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea572f5...4f4fc51. Read the comment docs.


/**
* 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.

*
* @param <ResponseT>
*/
final class GrpcApiExceptionResponseObserver<ResponseT> implements ApiStreamObserver<ResponseT> {

This comment was marked as spam.

This comment was marked as spam.

callable, grpcCallSettings.getParamsExtractor());
}
callable =
new GrpcExceptionServerStreamingCallable<>(callable, ImmutableSet.<StatusCode.Code>of());

This comment was marked as spam.

This comment was marked as spam.

@garrettjonesgoogle
Copy link
Member

@pongad PTAL

@igorbernstein2 igorbernstein2 changed the title ApiExceptions: Wrap errors streaming errors in ApiExceptions. ApiExceptions: Wrap streaming errors in ApiExceptions. Dec 15, 2017
}

private class ExceptionResponseObserver implements ResponseObserver<ResponseT> {
private ResponseObserver<ResponseT> innerObserver;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@pongad
Copy link
Contributor

pongad commented Dec 15, 2017

LGTM

@igorbernstein
Copy link

@garretjonesgoogle, let me know if there is anything else that needs to be polished here. If not, please merge

@garrettjonesgoogle garrettjonesgoogle merged commit c535e20 into googleapis:master Dec 19, 2017
@igorbernstein2 igorbernstein2 deleted the ssc-6-exceptions branch January 10, 2018 05:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Comments