# Smart Card Shell

- - Home
- - GPError
  - GPSystem
  - ByteString
  - ByteBuffer
  - TLV
  - TLVList
  - Card
  - Atr
  - Key
  - Crypto
  - Application
  - GPApplication
  - GPSecDomain
- - ASN1
  - CardFile
  - IsoSecureChannel
  - ApplFactory
  - GPXML
  - JsScript
  - CardSim
- - X509
  - CRL
  - KeyStore
  - Signed CMS
  - Enveloped CMS
  - CMS Generator
  - XMLSignature
  - SSS
  - OCSPQuery
  - LDAP
  - SOAP
  - URLConnection
- - PKCS11Provider
  - PKCS11Session
  - PKCS11Object
- - OutlineNode
  - Dialog
  - Task
- - Tools
  - Modules
- - OpenSCDP

# GPError - Reference Documentation

Exception class thrown by various GP functions

## Index of Methods

- GPError() constructor

## 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 | NOT_YET_VALID | Object is not yet valid
Number | EXPIRED | Object is expired
Number | SIGNATURE_FAILED | Signature verification failed
Number | AUTHENTICATION_FAILED | Authentication failed
Number | NOT_AUTHENTICATED | Not authenticated for operation
Number | AUTHENTICATION_METHOD_BLOCKED | Authentication method is blocked
Number | OUT_OF_MEMORY | Out of memory
Number | CARD_CONNECT_FAILED | Failed to connect to card
Number | CARD_REMOVED | Card removed
Number | USER_ABORT | Operation aborted by user
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
String | stack | List of file names and line numbers resembling the call stack

## 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

Name | Value | Description
--- | --- | ---

### 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);
    	print(e.stack);
    }

© Copyright 2003 - 2026 CardContact Systems GmbH , Minden, Germany