Package org.apache.juneau.rest.client
Class RestCallException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.http.HttpException
org.apache.juneau.rest.client.RestCallException
- All Implemented Interfaces:
- Serializable
Exception representing a 400+  HTTP response code against a remote resource or other exception.
 
See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionRestCallException(int statusCode, Thrown thrown, Throwable cause, String message, Object... args) Constructor.RestCallException(RestResponse response, Throwable cause, String message, Object... args) Constructor.
- 
Method SummaryModifier and TypeMethodDescription<T extends Throwable>
 TSimilar toThrowable.getCause()but searches until it finds the throwable of the specified type.intReturns the HTTP response status code.Returns the value of the"Thrown" header on the response.Methods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
RestCallExceptionConstructor.- Parameters:
- response- The HTTP response. Can be- null .
- cause- The cause of this exception.
- message- The- MessageFormat-style message.
- args- Optional- MessageFormat-style arguments.
 
- 
RestCallExceptionpublic RestCallException(int statusCode, Thrown thrown, Throwable cause, String message, Object... args) Constructor.- Parameters:
- statusCode- The HTTP response status code. Use- 0 if no connection could be made.
- thrown- The value of the- "Thrown" header on the response. Can be- null .
- cause- The cause of this exception.
- message- The- MessageFormat-style message.
- args- Optional- MessageFormat-style arguments.
 
 
- 
- 
Method Details- 
getThrownReturns the value of the"Thrown" header on the response.- Returns:
- The value of the "Thrown" header on the response, nevernull .
 
- 
getResponseCodeReturns the HTTP response status code.- Returns:
- The response status code.  If a connection could not be made at all, returns 0 .
 
- 
getCauseSimilar toThrowable.getCause()but searches until it finds the throwable of the specified type.- Type Parameters:
- T- The throwable type.
- Parameters:
- c- The throwable type.
- Returns:
- The cause of the specified type, or null of not found.
 
 
-