Class HttpException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.meterware.httpunit.HttpException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
HttpInternalErrorException, HttpNotFoundException
This exception is thrown when an Http error (response code 4xx or 5xx) is detected.
- Author:
- Seth Ladd, Russell Gold
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpException(int responseCode) throw a http Exception with the given responseCodeprotectedHttpException(int responseCode, String responseMessage, URL baseURL) throw a http Exception with the given responseCode and Message and base urlprotectedHttpException(int responseCode, String responseMessage, URL baseURL, Throwable cause) throw a http Exception with the given responseCode and Message, base url and causeprotectedHttpException(int responseCode, Throwable cause) throw a http Exception with the given responseCode and cause -
Method Summary
Modifier and TypeMethodDescriptiongetCause()get the cause (if any)get the Message for the http Exceptionintget the response Code of this http Exceptionget the response Message of this http ExceptionMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HttpException
protected HttpException(int responseCode) throw a http Exception with the given responseCode- Parameters:
responseCode-
-
HttpException
throw a http Exception with the given responseCode and cause- Parameters:
responseCode-cause-
-
HttpException
-
HttpException
-
-
Method Details
-
getMessage
get the Message for the http Exception- Overrides:
getMessagein classThrowable- Returns:
- - the message of the Exception
-
getResponseCode
public int getResponseCode()get the response Code of this http Exception- Returns:
- - the response Code code 4xx or 5xx
-
getResponseMessage
get the response Message of this http Exception- Returns:
- the response message
-
getCause
-