Clarify exception message when ALPN is not supported (#10155)

Motivation:

We should provide more informations when ALPN is not supported and a user tries to use it.

Modifications:

- Use UnsupportedOperationException

Result:

Easier to debug ALPN problems
This commit is contained in:
Norman Maurer 2020-04-22 08:07:27 +02:00 committed by GitHub
parent 5cd00d22d9
commit d0c2f6e8b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,7 +144,8 @@ public final class JdkAlpnApplicationProtocolNegotiator extends JdkBaseApplicati
return isServer ? JettyAlpnSslEngine.newServerEngine(engine, applicationNegotiator)
: JettyAlpnSslEngine.newClientEngine(engine, applicationNegotiator);
}
throw new RuntimeException("Unable to wrap SSLEngine of type " + engine.getClass().getName());
throw new UnsupportedOperationException("ALPN not supported. Unable to wrap SSLEngine of type '"
+ engine.getClass().getName() + "')");
}
}