Skip to content

Commit f264c58

Browse files
committed
throw exception in TrustManager in more standard way.
1 parent 9fdaa36 commit f264c58

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

s2a/src/main/java/io/grpc/s2a/internal/handshaker/S2ATrustManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ private void checkPeerTrusted(X509Certificate[] chain, boolean isCheckingClientC
120120
SessionResp resp;
121121
try {
122122
resp = stub.send(reqBuilder.build());
123-
} catch (IOException | InterruptedException e) {
124-
if (e instanceof InterruptedException) {
125-
Thread.currentThread().interrupt();
126-
}
123+
} catch (IOException e) {
124+
throw new CertificateException("Failed to send request to S2A.", e);
125+
} catch (InterruptedException e) {
126+
Thread.currentThread().interrupt();
127127
throw new CertificateException("Failed to send request to S2A.", e);
128128
}
129129
if (resp.hasStatus() && resp.getStatus().getCode() != 0) {

0 commit comments

Comments
 (0)