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
parent 2f4fa3444e
commit ffaf9cab65

View File

@ -144,7 +144,8 @@ public final class JdkAlpnApplicationProtocolNegotiator extends JdkBaseApplicati
return isServer ? JettyAlpnSslEngine.newServerEngine(engine, applicationNegotiator) return isServer ? JettyAlpnSslEngine.newServerEngine(engine, applicationNegotiator)
: JettyAlpnSslEngine.newClientEngine(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() + "')");
} }
} }