Package com.moesif.api.exceptions
Class APIException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.moesif.api.exceptions.APIException
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAPIException(String reason) Initialization constructorAPIException(String reason, HttpContext context) Initialization constructor -
Method Summary
Modifier and TypeMethodDescriptionThe HTTP response body from the API requestintThe HTTP response code from the API requestMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
APIException
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:
- the HTTP status code
-
getHttpContext
The HTTP response body from the API request- Returns:
- the HTTP context containing HTTO response
-