Package com.stripe.exception
Class StripeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.stripe.exception.StripeException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ApiConnectionException
,ApiException
,AuthenticationException
,CardException
,EventDataObjectDeserializationException
,IdempotencyException
,InvalidRequestException
,OAuthException
,SignatureVerificationException
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCode()
Returns the error code of the response that triggered this exception.Returns a description of the exception, including the HTTP status code and request ID (if applicable).Returns the request ID of the request that triggered this exception.Returns the status code of the response that triggered this exception.The error resource returned by Stripe's API that caused the exception.Returns a description of the user facing exceptionstatic StripeException
parseV2Exception
(String type, com.google.gson.JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) void
void
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
Method Details
-
setStripeError
-
setStripeV2Error
-
getMessage
Returns a description of the exception, including the HTTP status code and request ID (if applicable).- Overrides:
getMessage
in classThrowable
- Returns:
- a string representation of the exception.
-
getUserMessage
Returns a description of the user facing exception- Returns:
- a string representation of the user facing exception.
-
parseV2Exception
public static StripeException parseV2Exception(String type, com.google.gson.JsonObject body, int statusCode, String requestId, StripeResponseGetter responseGetter) -
getStripeError
The error resource returned by Stripe's API that caused the exception. -
getStripeErrorApiMode
-
getCode
Returns the error code of the response that triggered this exception. ForApiException
the error code will be equal toStripeError.getCode()
.- Returns:
- the string representation of the error code.
-
getRequestId
Returns the request ID of the request that triggered this exception.- Returns:
- the request ID.
-
getStatusCode
Returns the status code of the response that triggered this exception.- Returns:
- the status code.
-