Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
A workaround to pass null analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed Jan 19, 2018
1 parent f06a1b7 commit 16afb30
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,15 @@ void export() {
metricServiceClient.createTimeSeries(request);
span.addAnnotation("Finish exporting TimeSeries.");
} catch (com.google.api.gax.rpc.UnavailableException e) {
if (e.getLocalizedMessage() != null
&& e.getLocalizedMessage()
.startsWith(
"io.grpc.StatusRuntimeException: UNAVAILABLE: HTTP/2 error code: NO_ERROR")) {
continue; // Silently skip NO_ERROR Goaway
if (e.getLocalizedMessage() != null) {
String message = e.getLocalizedMessage();
if (message == null) {
throw new AssertionError(); // To pass null check
}
if (message.startsWith(
"io.grpc.StatusRuntimeException: UNAVAILABLE: HTTP/2 error code: NO_ERROR")) {
continue; // Silently skip NO_ERROR Goaway
}
} else {
logAndSetSpanStatusForApiException(e, span);
}
Expand Down

0 comments on commit 16afb30

Please sign in to comment.