Package com.authlete.common.api
Class AuthleteApiException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.authlete.common.api.AuthleteApiException
-
- All Implemented Interfaces:
Serializable
public class AuthleteApiException extends RuntimeException
Authlete API exception.- Author:
- Takahiko Kawasaki
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AuthleteApiException()
Constructor.AuthleteApiException(int statusCode, String statusMessage, String responseBody)
Constructor with HTTP response information.AuthleteApiException(String message)
Constructor with an error message.AuthleteApiException(String message, int statusCode, String statusMessage, String responseBody)
Constructor with an error message and HTTP response information.AuthleteApiException(String message, int statusCode, String statusMessage, String responseBody, Map<String,List<String>> responseHeaders)
Constructor with an error message and HTTP response information.AuthleteApiException(String message, Throwable cause)
Constructor with an error message and the cause.AuthleteApiException(String message, Throwable cause, int statusCode, String statusMessage, String responseBody)
Constructor with an error message, the cause and HTTP response information.AuthleteApiException(String message, Throwable cause, int statusCode, String statusMessage, String responseBody, Map<String,List<String>> responseHeaders)
Constructor with an error message, the cause and HTTP response information.AuthleteApiException(Throwable cause)
Constructor with the cause.AuthleteApiException(Throwable cause, int statusCode, String statusMessage, String responseBody)
Constructor with the cause and HTTP response information.AuthleteApiException(Throwable cause, int statusCode, String statusMessage, String responseBody, Map<String,List<String>> responseHeaders)
Constructor with the cause and HTTP response information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getResponseBody()
Get the response body contained in the response from Authlete server.Map<String,List<String>>
getResponseHeaders()
Get the response headers contained in the response from Authlete server.int
getStatusCode()
Get the HTTP status code contained in the response from Authlete server.String
getStatusMessage()
Get the HTTP status message contained in the response from Authlete server.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
AuthleteApiException
public AuthleteApiException()
Constructor.
-
AuthleteApiException
public AuthleteApiException(int statusCode, String statusMessage, String responseBody)
Constructor with HTTP response information.- Parameters:
statusCode
- HTTP status code.statusMessage
- HTTP status message.responseBody
- HTTP response body.
-
AuthleteApiException
public AuthleteApiException(String message)
Constructor with an error message.- Parameters:
message
- Error message.
-
AuthleteApiException
public AuthleteApiException(String message, int statusCode, String statusMessage, String responseBody)
Constructor with an error message and HTTP response information.- Parameters:
message
- Error message.statusCode
- HTTP status code.statusMessage
- HTTP status message.responseBody
- HTTP response body.
-
AuthleteApiException
public AuthleteApiException(String message, int statusCode, String statusMessage, String responseBody, Map<String,List<String>> responseHeaders)
Constructor with an error message and HTTP response information.- Parameters:
message
- Error message.statusCode
- HTTP status code.statusMessage
- HTTP status message.responseBody
- HTTP response body.responseHeaders
- Http response headers.- Since:
- 1.13
-
AuthleteApiException
public AuthleteApiException(Throwable cause)
Constructor with the cause.- Parameters:
cause
- The cause of this exception.
-
AuthleteApiException
public AuthleteApiException(Throwable cause, int statusCode, String statusMessage, String responseBody)
Constructor with the cause and HTTP response information.- Parameters:
cause
- The cause of this exception.statusCode
- HTTP status code.statusMessage
- HTTP status message.responseBody
- HTTP response body.
-
AuthleteApiException
public AuthleteApiException(Throwable cause, int statusCode, String statusMessage, String responseBody, Map<String,List<String>> responseHeaders)
Constructor with the cause and HTTP response information.- Parameters:
cause
- The cause of this exception.statusCode
- HTTP status code.statusMessage
- HTTP status message.responseBody
- HTTP response body.responseHeaders
- HTTP response headers.- Since:
- 1.13
-
AuthleteApiException
public AuthleteApiException(String message, Throwable cause)
Constructor with an error message and the cause.- Parameters:
message
- Error message.cause
- The cause of this exception.
-
AuthleteApiException
public AuthleteApiException(String message, Throwable cause, int statusCode, String statusMessage, String responseBody)
Constructor with an error message, the cause and HTTP response information.- Parameters:
message
- Error message.cause
- The cause of this exception.statusCode
- HTTP status code.statusMessage
- HTTP status message.responseBody
- HTTP response body.
-
AuthleteApiException
public AuthleteApiException(String message, Throwable cause, int statusCode, String statusMessage, String responseBody, Map<String,List<String>> responseHeaders)
Constructor with an error message, the cause and HTTP response information.- Parameters:
message
- Error message.cause
- The cause of this exception.statusCode
- HTTP status code.statusMessage
- HTTP status message.responseBody
- HTTP response body.responseHeaders
- HTTP response headers.- Since:
- 1.13
-
-
Method Detail
-
getStatusCode
public int getStatusCode()
Get the HTTP status code contained in the response from Authlete server.Note that this method may return 0 if this exception was raised before the response from Authlete server was obtained.
- Returns:
- HTTP status code.
-
getStatusMessage
public String getStatusMessage()
Get the HTTP status message contained in the response from Authlete server.Note that this method may return
null
if this exception was raised before the response from Authlete server was obtained.- Returns:
- HTTP status message.
-
getResponseBody
public String getResponseBody()
Get the response body contained in the response from Authlete server.Note that this method may return
null
if this exception was raised before the response from Authlete server was obtained or if the response did not contain any content.- Returns:
- HTTP response body.
-
getResponseHeaders
public Map<String,List<String>> getResponseHeaders()
Get the response headers contained in the response from Authlete server.Note that this method may return
null
if this exception was raised before the response from Authlete server was obtained.- Returns:
- HTTP response headers.
- Since:
- 1.13
-
-