com.ibm.jc
Class JCException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bycom.ibm.jc.JCException
All Implemented Interfaces:
java.io.Serializable

public class JCException
extends java.lang.RuntimeException

Abstraction encapsulating OpenPlatform/JavaCard specific error codes.

See Also:
Serialized Form

Field Summary
 byte[] apdu
          The response APDU which triggered this exception or null if not supplied.
static int AUTH_FAILED
          Authentication failed.
 int errorCode
          APDU and off-card error codes.
static int FAILED
          Catch all for unspecific failures.
static int ILLEGAL_STATE
          Operation could not performed because of some illegal state.
static int INVALID_PARAM
          Some parameter to some off-card API was not valid.
static int MALFORMED_REPLY
          Response APDU could not be parsed by off-card API.
static int NO_ERROR_CODE
          The error code is not valid.
static int SHORT_REPLY
          Returned APDU was shorter than 2 bytes - Could not retrieve 2 byte status code.
static int TERMINAL_ERROR
          Some card terminal error.
 
Constructor Summary
JCException(int errorCode, byte[] apdu, java.lang.String message)
           
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ERROR_CODE

public static final int NO_ERROR_CODE
The error code is not valid. No error code was supplied by the creator of the exception. This constant has value -1.

See Also:
Constant Field Values

SHORT_REPLY

public static final int SHORT_REPLY
Returned APDU was shorter than 2 bytes - Could not retrieve 2 byte status code. This constant has value -2.

See Also:
Constant Field Values

INVALID_PARAM

public static final int INVALID_PARAM
Some parameter to some off-card API was not valid. This constant has value -3.

See Also:
Constant Field Values

MALFORMED_REPLY

public static final int MALFORMED_REPLY
Response APDU could not be parsed by off-card API. This constant has value -4.

See Also:
Constant Field Values

AUTH_FAILED

public static final int AUTH_FAILED
Authentication failed. This constant has value -5.

See Also:
Constant Field Values

TERMINAL_ERROR

public static final int TERMINAL_ERROR
Some card terminal error. This constant has value -6.

See Also:
Constant Field Values

ILLEGAL_STATE

public static final int ILLEGAL_STATE
Operation could not performed because of some illegal state. This constant has value -7.

See Also:
Constant Field Values

FAILED

public static final int FAILED
Catch all for unspecific failures. This constant has value -8.

See Also:
Constant Field Values

errorCode

public int errorCode
APDU and off-card error codes. Values between 0 and 0xFFFF (inclusive) represent status codes as contained response APDUs.


apdu

public byte[] apdu
The response APDU which triggered this exception or null if not supplied. The APDU can be supplied for further error parsing in higher software layers.

Constructor Detail

JCException

public JCException(int errorCode,
                   byte[] apdu,
                   java.lang.String message)
Parameters:
errorCode - the errorCode
apdu - the offending APDU or null
message - some message or null
Method Detail

toString

public java.lang.String toString()