public class HttpException
extends java.io.IOException
IOException for http exceptions because HttpURLConnection throws un-discerned
IOException and it can help to know the http response code to decide how to handle an
http exceptions.| Constructor and Description |
|---|
HttpException(int responseCode,
java.lang.String responseMessage,
java.lang.String url,
java.lang.Throwable cause) |
HttpException(int responseCode,
java.lang.String responseMessage,
java.net.URL url,
java.lang.Throwable cause) |
HttpException(java.lang.String message,
int responseCode,
java.lang.String responseMessage,
java.lang.String url) |
HttpException(java.lang.String message,
int responseCode,
java.lang.String responseMessage,
java.lang.String url,
java.lang.Throwable cause) |
| Modifier and Type | Method and Description |
|---|---|
int |
getResponseCode()
Http response code of the request that cause the exception
|
java.lang.String |
getResponseMessage()
Http response message of the request that cause the exception
|
java.lang.String |
getUrl()
The http URL that caused the exception
|
public HttpException(java.lang.String message,
int responseCode,
java.lang.String responseMessage,
java.lang.String url)
message - The detail message (which is saved for later retrieval
by the Throwable.getMessage() method)responseCode - Http response code. -1 if no code can be discerned.responseMessage - Http response messageurl - The url that was invokedHttpURLConnection.getResponseCode(),
HttpURLConnection.getResponseMessage()public HttpException(java.lang.String message,
int responseCode,
java.lang.String responseMessage,
java.lang.String url,
java.lang.Throwable cause)
message - The detail message (which is saved for later retrieval
by the Throwable.getMessage() method)responseCode - Http response code. -1 if no code can be discerned.responseMessage - Http response messageurl - The url that was invokedcause - The cause (which is saved for later retrieval by the
Throwable.getCause() method). (A null value is permitted,
and indicates that the cause is nonexistent or unknown.)HttpURLConnection.getResponseCode(),
HttpURLConnection.getResponseMessage()public HttpException(int responseCode,
java.lang.String responseMessage,
java.lang.String url,
java.lang.Throwable cause)
responseCode - Http response code. -1 if no code can be discerned.responseMessage - Http response messageurl - The url that was invokedcause - The cause (which is saved for later retrieval by the
Throwable.getCause() method). (A null value is permitted,
and indicates that the cause is nonexistent or unknown.)HttpURLConnection.getResponseCode(),
HttpURLConnection.getResponseMessage()public HttpException(int responseCode,
java.lang.String responseMessage,
@CheckForNull
java.net.URL url,
java.lang.Throwable cause)
responseCode - Http response code. -1 if no code can be discerned.responseMessage - Http response messageurl - The url that was invokedcause - The cause (which is saved for later retrieval by the
Throwable.getCause() method). (A null value is permitted,
and indicates that the cause is nonexistent or unknown.)HttpURLConnection.getResponseCode(),
HttpURLConnection.getResponseMessage()public int getResponseCode()
-1 if no code can be discerned.public java.lang.String getResponseMessage()
null if no response message can be discerned.public java.lang.String getUrl()
Copyright © 2016. All Rights Reserved.