Package com.bandwidth.exceptions
Class ApiException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.bandwidth.exceptions.ApiException
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ApiErrorResponseException
,ErrorException
,ErrorWithRequestException
,ForbiddenRequestException
,MessagingException
,UnauthorizedRequestException
public class ApiException
extends java.lang.Exception
This is the base class for all exceptions that represent an error response from the server.
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description ApiException(java.lang.String reason)
Initialization constructor.ApiException(java.lang.String reason, HttpContext context)
Initialization constructor. -
Method Summary
Modifier and Type Method Description HttpContext
getHttpContext()
The HTTP response body from the API request.int
getResponseCode()
The HTTP response code from the API request.
-
Constructor Details
-
ApiException
public ApiException(java.lang.String reason)Initialization constructor.- Parameters:
reason
- The reason for throwing exception
-
ApiException
Initialization constructor.- Parameters:
reason
- The reason for throwing exceptioncontext
- The http context of the API exception
-
-
Method Details
-
getResponseCode
public int getResponseCode()The HTTP response code from the API request.- Returns:
- Returns the response code for ApiException
-
getHttpContext
The HTTP response body from the API request.- Returns:
- Returns the object of HttpContext for ApiException
-