πŸ”Œ Why There's No HTTP Status Code

HTTP status codes (like 200 OK, 404 Not Found, 500 Internal Server Error) are sent by the server.

But if you get a connection error or timeout, it means:

Since the server never received or processed the request:

πŸ‘‰ No response = No HTTP status = No Response object


🚫 Examples of Non-Status-Code Errors

Cause Thrown Exception HTTP Status?
Keycloak server unreachable java.net.ConnectException ❌ No
TLS/SSL failure javax.net.ssl.SSLHandshakeException ❌ No
Request took too long java.net.SocketTimeoutException ❌ No
DNS resolution fails UnknownHostException ❌ No

All of these are usually wrapped inside:

Note that the exception javax.ws.rs.ProcessingException is used to indicate (internal) JAX-RS processing errors. It is not used to indicate HTTP error response states. A HTTP error response is represented by aΒ WebApplicationExceptionΒ class or one of it's sub-classes