net.rimlib.blackberry.api.paymentsdk
Class PaymentException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by net.rimlib.blackberry.api.paymentsdk.PaymentException
All Implemented Interfaces:
java.io.Serializable, ResultCodes
Direct Known Subclasses:
AppWorldUpdateRequired, DigitalGoodNotFoundException, IllegalApplicationException, PaymentServerException, UserCancelException

public class PaymentException
extends java.lang.Exception
implements ResultCodes

Thrown when a generic failure occurs with one of the PaymentEngine methods. Since all other exceptions specified in the Payment Service API are subclasses of PaymentException, if you want to handle all exceptions the same way, you only need to catch PaymentException to do so. If you want to handle each exception uniquely, you can catch PaymentServerException, DigitalGoodNotFoundException, UserCancelException, and IllegalApplicationException separately.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface net.rimlib.blackberry.api.paymentsdk.ResultCodes
REASON_APP_WORLD_NOT_CORRECT_VERSION, REASON_ARGUMENTS_ERROR, REASON_CANCELED, REASON_GOOD_NOT_FOUND, REASON_ILLEGAL_APPLICATION, REASON_NONE, REASON_SERVER_ERROR, REASON_UNKNOWN
 
Constructor Summary
PaymentException(java.lang.String message)
          Creates an exception with the given detail message.
PaymentException(java.lang.String message, int failureReasonIn)
          Creates an exception with the given detail message.
 
Method Summary
 int getFailureReason()
          Retrieves a constant representing the reason this result is unsuccessful, or REASON_NONE if this result is successful.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PaymentException

public PaymentException(java.lang.String message)
Creates an exception with the given detail message.

Parameters:
message - The detail message.

PaymentException

public PaymentException(java.lang.String message,
                        int failureReasonIn)
Creates an exception with the given detail message.

Parameters:
message - The detail message.
failureReasonIn - One of the REASON_* constants in this interface .
Method Detail

getFailureReason

public int getFailureReason()
Retrieves a constant representing the reason this result is unsuccessful, or REASON_NONE if this result is successful.

Returns:
One of the REASON_* constants. If this result is successful, then REASON_NONE is returned.


Copyright © 2011 Research In Motion Limited. All Rights Reserved.