From 5b7a21ab037d24fe03979fadab7dfca208dedfa5 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Mon, 1 Aug 2016 09:44:58 -0700 Subject: [PATCH] okhttp: Remove wrong status description The != should have been ==. However, it is provable that the exception won't be null, but we want to make that fact obvious when auditing. So we just fail if the exception is ever null. --- .../src/main/java/io/grpc/okhttp/OkHttpClientTransport.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java b/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java index 7e147301f3..544851a4a2 100644 --- a/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java +++ b/okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java @@ -548,10 +548,8 @@ class OkHttpClientTransport implements ConnectionClientTransport { * Finish all active streams due to an IOException, then close the transport. */ void onException(Throwable failureCause) { + Preconditions.checkNotNull(failureCause, "failureCause"); Status status = Status.UNAVAILABLE.withCause(failureCause); - if (failureCause != null) { - status = status.augmentDescription("No provided cause"); - } startGoAway(0, ErrorCode.INTERNAL_ERROR, status); }