com.sssw.rt.util
Class AgoHTTPStatusException
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--com.sssw.rt.util.AgoException
|
+--com.sssw.rt.util.AgoHTTPStatusException
- All Implemented Interfaces:
- AgiParentedException, Serializable
- public class AgoHTTPStatusException
- extends AgoException
An exception corresponding to an unsuccessful
HTTP status.
See the HTTP specification at www.w3.org for a list of status codes.
In general status codes are three decimal digits. The high order digit
specifies the class of the status code as follows:
Value |
Meaning |
100 |
Informational |
200 |
Successful |
300 |
Redirection |
400 |
Client Error |
500 |
Server Error |
Note that an AgoHTTPStatusException should never be generated for a
status code in the 200-299 range since that indicates success.
- See Also:
- Serialized Form
Method Summary |
int |
getStatus()
Returns the HTTP status code of this exception. |
Methods inherited from class com.sssw.rt.util.AgoException |
copyTo,
getExceptionHTML,
getExceptionMessage,
getExceptionMessage,
getHTML,
getMessage,
getMessage,
getParentException,
printStackTrace,
printStackTrace,
printStackTrace,
setHTML |
AgoHTTPStatusException
public AgoHTTPStatusException(int status,
URL url)
- Constructor
- Parameters:
status
- the HTTP status codeurl
- the content-body returned in the HTTP response
getStatus
public int getStatus()
- Returns the HTTP status code of this exception. This code should not be
in the range 200 to 299, since these are success codes.
- Example:
try {
// some remote operation
}
catch (AgoHTTPStatusException x) {
System.out.println("Status code returned was " +x.getStatus());
}