Class Http2RequiredException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
co.ankatech.ankasecure.sdk.exception.Http2RequiredException
- All Implemented Interfaces:
Serializable
A streaming request that requires HTTP/2 was about to be sent over a connection that negotiated
something else, and was refused before any request byte was written.
Why this is fail-closed rather than a downgrade
The eleven true-streaming endpoints send their request body as a duplex stream, interleaved with the response. HTTP/1.1 has no such framing: the request must be written in full before the response is read. Attempting it does not degrade gracefully — it produces the deadlock this whole feature exists to remove, surfacing minutes later as a stream reset or a read timeout, with no indication of the real cause. Refusing up front, naming the reason, is the only outcome a caller can act on.Why it is UNCHECKED
It is raised from an OkHttpInterceptor, whose intercept declares only
throws IOException — but an unchecked exception needs no declaration and propagates out of
Call.execute() untouched, which is asserted by Http2RequiredFailClosedTest.
🔴 It was originally an IOException and that was a defect: the type did not reach the
caller. The streaming call path has a dedicated re-throw arm for it, but the four service impls
one layer up carry 24 catch (ApiException | IOException) arms that translate
everything into a generic AnkaSecureSdkException. So catch (Http2RequiredException)
was unreachable from every public entry point, while this class's own Javadoc and the published
integrator documentation both promised it worked. Extending AnkaSecureSdkException — the
same choice StreamWriteFailedException makes, and the reason that one always survived —
is what makes the promise true.
Disclosure
The message names the negotiated protocol and the requirement, and nothing else — no tenant, key id, host, path, header or payload byte. It is raised on an authenticated path, so anything it says is said to whoever provoked it.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Http2RequiredExceptionThe configuration-refusal form: HTTP/2 was disabled by configuration, so a streaming request cannot be honoured.Methods inherited from class co.ankatech.ankasecure.sdk.exception.AnkaSecureSdkException
getContext, getErrorCode, getHttpStatus, getResponseBody, getRetryAfterSecondsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
Http2RequiredException
-
-
Method Details
-
disabledByConfiguration
The configuration-refusal form: HTTP/2 was disabled by configuration, so a streaming request cannot be honoured. A configuration that cannot be satisfied is reported, never silently ignored.- Returns:
- the refusal for a deployment that disabled HTTP/2
-