GPError - Reference Documentation
Exception class thrown by various GP functions
Index of Methods
Constants
| Type | Name | Description |
| Number | ACCESS_DENIED | Access to resource denied |
| Number | ARGUMENTS_MISSING | A required argument is missing from the argument list |
| Number | CARD_COMM_ERROR | Card communication error |
| Number | CARD_INVALID_SW | A SW1/SW2 returned by the ICC is not as expected |
| Number | CRYPTO_FAILED | Cryptographic operation failed |
| Number | DATA_TOO_LARGE | Data supplied is too large for operation |
| Number | DEVICE_ERROR | Hardware device reported error |
| Number | INVALID_ARGUMENTS | Too many arguments supplied in argument list |
| Number | INVALID_DATA | Invalid data supplied as argument |
| Number | INVALID_ENCODING | Invalid encoding format used in argument |
| Number | INVALID_INDEX | Index is out of bounds |
| Number | INVALID_KEY | Invalid key for operation |
| Number | INVALID_LENGTH | Length is out of range |
| Number | INVALID_MECH | Invalid mechanism specified |
| Number | INVALID_TAG | Invalid tag value or format |
| Number | INVALID_TYPE | Invalid type given as argument |
| Number | INVALID_USAGE | Invalid usage |
| Number | KEY_NOT_FOUND | Key not found |
| Number | OBJECTCREATION- FAILED | Object could not be created |
| Number | SECURE_CHANNEL_ WRONG_STATE | Secure channel is in wrong state for desired operation |
| Number | TAG_ALREADY_EXISTS | Tag does already exist in TLVList that must contain unique tags |
| Number | TAG_NOT_FOUND | Tag not found |
| Number | OBJECT_NOT_FOUND | Object could not be found |
| Number | UNDEFINED | Undefined error code |
| Number | UNSUPPORTED | Unsupported operation |
| Number | USER_DEFINED | User defined error |
Properties
| Type | Name | Description |
| String | className | Class throwing the exception |
| Number | error | Error code. Must be one of the defined constants |
| Number | reason | Reason for exception, e.g. the argument causing the exception |
| String | message | Human readable message describing the error |
| String | fileName | The name of the file containing the source code |
| Number | lineNumber | The line in the source code where the exception occurred |
Constructor
Prototype
GPError(String className, Number error, Number reason, String message)
Description
Create a new GPError object with the fields set to the arguments.
Arguments
| Type | Name | Description |
String | className | Class throwing the exception |
Number | error | Error code. Must be one of the defined constants |
Number | reason | Reason for exception, e.g. the argument causing the exception |
String | message | Human readable message describing the error |
Exceptions
Example
// Throw from within script
try {
throw new GPError("test.class", 1, 2, "script");
assert(false);
}
catch(e) {
assert(e instanceof GPError);
assert(e.className == "test.class");
assert(e.error == 1);
assert(e.reason == 2);
assert(e.message == "script");
print(e.fileName);
print(e.lineNumber);
}
© Copyright 2003 - 2010 CardContact
Software & System Consulting, Minden, Germany