Package org.apache.juneau.rest.client
Class RestCallException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.apache.juneau.rest.client.RestCallException
- All Implemented Interfaces:
Serializable
Exception thrown when an HTTP call fails at the REST client level (e.g. unexpected status code, body
deserialization failure, or interceptor rejection).
Network-level failures are reported as TransportException.
- Since:
- 9.2.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRestCallException(int statusCode, String message) Constructor — for cases with an HTTP status code (e.g. unexpected 4xx/5xx).RestCallException(int statusCode, String message, Throwable cause) Constructor — for cases with an HTTP status code and a cause.RestCallException(String message, Throwable cause) Constructor — for cases without an HTTP status code (e.g. deserialization failure). -
Method Summary
Modifier and TypeMethodDescriptionintReturns the HTTP status code, or-1if not applicable.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RestCallException
Constructor — for cases without an HTTP status code (e.g. deserialization failure).- Parameters:
message- The error message.cause- The underlying cause. May benull .
-
RestCallException
Constructor — for cases with an HTTP status code (e.g. unexpected 4xx/5xx).- Parameters:
statusCode- The HTTP status code.message- The error message.
-
RestCallException
Constructor — for cases with an HTTP status code and a cause.- Parameters:
statusCode- The HTTP status code.message- The error message.cause- The underlying cause. May benull .
-
-
Method Details
-
getStatusCode
Returns the HTTP status code, or-1if not applicable.- Returns:
- The status code.
-