TransportFailure
A failure of the exchange itself: the request never completed, or completed with something no HttpResponse can hold. Produced by an HttpTransport and by the URL policy.
Experimental (subclass). Subclassing needs @OptIn(ExperimentalForInheritanceWebToolsApi::class); catching, matching and reading a failure are Stable Core. Every leaf nested here is final and has a public constructor, so a transport or a fake can produce any of them. Match the leaves you care about and keep an else: new leaves may be added in a feature release. Messages are constant text plus non-sensitive fields; the cause, when present, is the producer's decision and may carry what the message never does.
Inheritors
Types
The response body is larger than the transport's limit.
No connection to the server could be established.
The host name could not be resolved.
The request broke a rule before it could be sent.
An I/O error interrupted the exchange after the connection was made.
The server's response broke the HTTP protocol, a status outside 100..599 included.
The outbound-URL policy refused the request or a redirect hop.
The transport refused to send the request a second time, because it is not safe to repeat.
The request did not complete within the transport's timeout.
The TLS handshake failed.
The request was redirected more often than the transport allows.