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
public class APIException extends Exception
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description APIException(String reason)Initialization constructorAPIException(String reason, HttpContext context)Initialization constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpContextgetHttpContext()The HTTP response body from the API requestintgetResponseCode()The HTTP response code from the API request-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
APIException
public APIException(String reason)
Initialization constructor- Parameters:
reason- The reason for throwing exception
-
APIException
public APIException(String reason, HttpContext context)
Initialization constructor- Parameters:
reason- The reason for throwing exceptioncontext- The http context of the API exception
-
-
Method Detail
-
getResponseCode
public int getResponseCode()
The HTTP response code from the API request- Returns:
- the HTTP status code
-
getHttpContext
public HttpContext getHttpContext()
The HTTP response body from the API request- Returns:
- the HTTP context containing HTTO response
-
-