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

public abstract class StripeException extends Exception
See Also:
  • Constructor Details

    • StripeException

      protected StripeException(String message, String requestId, String code, Integer statusCode)
    • StripeException

      protected StripeException(String message, String requestId, String code, Integer statusCode, Throwable e)
      Constructs a new Stripe exception with the specified details.
  • Method Details

    • getMessage

      public String getMessage()
      Returns a description of the exception, including the HTTP status code and request ID (if applicable).
      Overrides:
      getMessage in class Throwable
      Returns:
      a string representation of the exception.
    • getUserMessage

      public String getUserMessage()
      Returns a description of the user facing exception
      Returns:
      a string representation of the user facing exception.
    • getStripeError

      public StripeError getStripeError()
      The error resource returned by Stripe's API that caused the exception.
    • getCode

      public String getCode()
      Returns the error code of the response that triggered this exception. For ApiException the error code will be equal to StripeError.getCode().
      Returns:
      the string representation of the error code.
    • getRequestId

      public String getRequestId()
      Returns the request ID of the request that triggered this exception.
      Returns:
      the request ID.
    • getStatusCode

      public Integer getStatusCode()
      Returns the status code of the response that triggered this exception.
      Returns:
      the status code.
    • setStripeError

      public void setStripeError(StripeError stripeError)
      The error resource returned by Stripe's API that caused the exception.