java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
org.kohsuke.github.GHIOException
org.kohsuke.github.HttpException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ServiceDownException
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.- Author:
- Cyrille Le Clerc
- See Also:
-
Field Summary
Fields inherited from class org.kohsuke.github.GHIOException
responseHeaderFields
-
Constructor Summary
ConstructorDescriptionHttpException
(int responseCode, String responseMessage, String url, Throwable cause) Instantiates a new Http exception.HttpException
(int responseCode, String responseMessage, URL url, Throwable cause) Instantiates a new Http exception.HttpException
(String message, int responseCode, String responseMessage, String url) Instantiates a new Http exception.HttpException
(String message, int responseCode, String responseMessage, String url, Throwable cause) Instantiates a new Http exception.HttpException
(GitHubConnectorResponse connectorResponse) Instantiates a new Http exception. -
Method Summary
Modifier and TypeMethodDescriptionint
Http response code of the request that cause the exception.Http response message of the request that cause the exception.getUrl()
The http URL that caused the exception.Methods inherited from class org.kohsuke.github.GHIOException
getResponseHeaderFields
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
HttpException
Instantiates a new Http exception.- Parameters:
message
- The detail message (which is saved for later retrieval by theThrowable.getMessage()
method)responseCode
- Http response code.-1
if no code can be discerned.responseMessage
- Http response messageurl
- The url that was invoked- See Also:
-
HttpException
public HttpException(String message, int responseCode, String responseMessage, String url, Throwable cause) Instantiates a new Http exception.- Parameters:
message
- The detail message (which is saved for later retrieval by theThrowable.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 theThrowable.getCause()
method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)- See Also:
-
HttpException
Instantiates a new Http exception.- Parameters:
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 theThrowable.getCause()
method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)- See Also:
-
HttpException
public HttpException(int responseCode, String responseMessage, @CheckForNull URL url, Throwable cause) Instantiates a new Http exception.- Parameters:
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 theThrowable.getCause()
method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)- See Also:
-
HttpException
Instantiates a new Http exception.- Parameters:
connectorResponse
- the connector response to base this on
-
-
Method Details
-
getResponseCode
public int getResponseCode()Http response code of the request that cause the exception.- Returns:
-1
if no code can be discerned.
-
getResponseMessage
Http response message of the request that cause the exception.- Returns:
null
if no response message can be discerned.
-
getUrl
The http URL that caused the exception.- Returns:
- url url
-