diff --git a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java index 0f890728d4..304b7507b0 100644 --- a/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java +++ b/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java @@ -176,8 +176,9 @@ final class ProtocolNegotiators { // Replace this handler with the GRPC handler. ctx.pipeline().replace(this, null, grpcHandler); } else { - fail(ctx, new Exception( - "Failed protocol negotiation: Unable to find compatible protocol.")); + fail(ctx, + unavailableException( + "Failed protocol negotiation: Unable to find compatible protocol")); } } else { fail(ctx, handshakeEvent.cause()); @@ -333,8 +334,8 @@ final class ProtocolNegotiators { ctx.pipeline().replace(ctx.name(), null, next); fireProtocolNegotiationEvent(ctx, handler.engine().getSession()); } else { - Exception ex = new Exception( - "Failed ALPN negotiation: Unable to find compatible protocol."); + Exception ex = + unavailableException("Failed ALPN negotiation: Unable to find compatible protocol"); logSslEngineDetails(Level.FINE, ctx, "TLS negotiation failed.", ex); ctx.fireExceptionCaught(ex); } @@ -859,4 +860,4 @@ final class ProtocolNegotiators { ctx.fireUserEventTriggered(pne.withAttributes(attrs)); } } -} \ No newline at end of file +}