**javacard.framework** ====Class APDUException ==== *[[javacard:java-card-api:object|java.lang.Object]] \\ *[[javacard:java-card-api:throwable|java.lang.Throwable]] \\ *[[javacard:java-card-api:exception|java.lang.Exception]] \\ *[[javacard:java-card-api:runtimeexception|java.lang.RuntimeException]] \\ *[[javacard:java-card-api:cardruntimeexception|javacard.framework.CardRuntimeException]] \\ ---- public class **APDUException**extends [[javacard:java-card-api:CardRuntimeException|CardRuntimeException]] APDUException represents an APDU related exception. The APDU class throws Java Card runtime environment-owned instances of APDUException. Java Card runtime environment-owned instances of exception classes are temporary Java Card runtime environment Entry Point Objects and can be accessed from any applet context. References to these temporary objects cannot be stored in class variables or instance variables or array components. See //Runtime Environment Specification for the Java Card Platform//, section 6.2.1 for details. **See Also:**[[javacard:java-card-api:APDU|APDU]] ---- ^ Field Summary ^^ | **static short** | **[[javacard:java-card-api:APDUException#BAD_LENGTH|BAD_LENGTH]] **          This reason code is used by the APDU.setOutgoingLength() method to indicate APDUException.BAD_LENGTH if len is negative, or greater than 256 and the currently selected applet does not implement the javacardx.apdu.ExtendedLength interface, or if non BLOCK CHAINED data transfer is requested and len is greater than (IFSD-2), where IFSD is the Outgoing Block Size. | | **static short** | **[[javacard:java-card-api:APDUException#BUFFER_BOUNDS|BUFFER_BOUNDS]] **          This reason code is used by the APDU.sendBytes() method to indicate that the sum of buffer offset parameter and the byte length parameter exceeds the APDU buffer size. | | **static short** | **[[javacard:java-card-api:APDUException#ILLEGAL_USE|ILLEGAL_USE]] **          This APDUException reason code indicates that the method should not be invokedbased on the current state of the APDU. | | **static short** | **[[javacard:java-card-api:APDUException#IO_ERROR|IO_ERROR]] **          This reason code indicates that an unrecoverable error occurred in the I/O transmission layer. | | **static short** | **[[javacard:java-card-api:APDUException#NO_T0_GETRESPONSE|NO_T0_GETRESPONSE]] **          This reason code indicates that during T=0 protocol, the CAD did not return a GET RESPONSEcommand in response to a < 61xx > response status to send additional data. | | **static short** | **[[javacard:java-card-api:APDUException#NO_T0_REISSUE|NO_T0_REISSUE]] **          This reason code indicates that during T=0 protocol, the CAD did not reissue the same APDU command with the corrected length in response to a < 6Cxx > response status to request command reissue with the specified length. | | **static short** | **[[javacard:java-card-api:APDUException#T1_IFD_ABORT|T1_IFD_ABORT]] **          This reason code indicates that during T=1 protocol, the CAD returned an ABORT S-Block command and aborted the data transfer. |   ^ Constructor Summary ^^ | **[[javacard:java-card-api:APDUException#APDUException(short)|APDUException]] **(short reason)          Constructs an APDUException. |   ^ Method Summary ^^ | **static void** | **[[javacard:java-card-api:APDUException#throwIt(short)|throwIt]] **(short reason)          Throws the Java Card runtime environment-owned instance of APDUException with the specified reason. |   ^ Methods inherited from class javacard.framework.CardRuntimeException ^ | [[javacard:java-card-api:CardRuntimeException#getReason()|getReason]] , [[javacard:java-card-api:CardRuntimeException#setReason(short)|setReason]] |   ^ Methods inherited from class java.lang.Object ^ | [[javacard:java-card-api:Object#equals(java.lang.Object)|equals]] |   ^ Field Detail ^ === ILLEGAL_USE === public static final short **ILLEGAL_USE** This APDUException reason code indicates that the method should not be invoked based on the current state of the APDU. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.APDUException.ILLEGAL_USE|Constant Field Values]] ---- === BUFFER_BOUNDS === public static final short **BUFFER_BOUNDS** This reason code is used by the APDU.sendBytes() method to indicate that the sum of buffer offset parameter and the byte length parameter exceeds the APDU buffer size. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.APDUException.BUFFER_BOUNDS|Constant Field Values]] ---- === BAD_LENGTH === public static final short **BAD_LENGTH** This reason code is used by the APDU.setOutgoingLength() method to indicate *APDUException.BAD_LENGTH if len is negative, or greater than 256 and the currently selected applet does not implement the javacardx.apdu.ExtendedLength interface, or if non BLOCK CHAINED data transfer is requested and len is greater than (IFSD-2), where IFSD is the Outgoing Block Size. The -2 accounts for the status bytes in T=1.**See Also:**[[javacard:java-card-api:constant-values#javacard.framework.APDUException.BAD_LENGTH|Constant Field Values]] \\ ---- === IO_ERROR === public static final short **IO_ERROR** This reason code indicates that an unrecoverable error occurred in the I/O transmission layer. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.APDUException.IO_ERROR|Constant Field Values]] ---- === NO_T0_GETRESPONSE === public static final short **NO_T0_GETRESPONSE** This reason code indicates that during T=0 protocol, the CAD did not return a GET RESPONSE command in response to a < 61xx > response status to send additional data. The outgoing transfer has been aborted. No more data or status can be sent to the CAD in this Applet.process() method. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.APDUException.NO_T0_GETRESPONSE|Constant Field Values]] ---- === T1_IFD_ABORT === public static final short **T1_IFD_ABORT** This reason code indicates that during T=1 protocol, the CAD returned an ABORT S-Block command and aborted the data transfer. The incoming or outgoing transfer has been aborted. No more data can be received from the CAD. No more data or status can be sent to the CAD in this Applet.process() method. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.APDUException.T1_IFD_ABORT|Constant Field Values]] ---- === NO_T0_REISSUE === public static final short **NO_T0_REISSUE** This reason code indicates that during T=0 protocol, the CAD did not reissue the same APDU command with the corrected length in response to a < 6Cxx > response status to request command reissue with the specified length. The outgoing transfer has been aborted. No more data or status can be sent to the CAD in this Applet.process() method. **See Also:**[[javacard:java-card-api:constant-values#javacard.framework.APDUException.NO_T0_REISSUE|Constant Field Values]] ^ Constructor Detail ^ === APDUException === public **APDUException**(short reason) Constructs an APDUException. To conserve on resources use throwIt() to use the Java Card runtime environment-owned instance of this class. **Parameters:**reason - the reason for the exception. ^ Method Detail ^ === throwIt === public static void **throwIt**(short reason) Throws the Java Card runtime environment-owned instance of APDUException with the specified reason. Java Card runtime environment-owned instances of exception classes are temporary Java Card runtime environment Entry Point Objects and can be accessed from any applet context. References to these temporary objects cannot be stored in class variables or instance variables or array components. See //Runtime Environment Specification for the Java Card Platform//, section 6.2.1 for details. **Parameters:**reason - the reason for the exception **Throws:** [[javacard:java-card-api:APDUException|APDUException]] - always