System exceptions are error conditions that can occur in any Dexterity-based application. Any operation that automatically displays an error dialog to the user is considered a system exception. Common examples of system exceptions are string overflow errors, division-by-zero errors and database errors.
Like user exceptions, all system exceptions are identified by a class and subclass. Both are long integer values. The classes are divided into three categories: script exceptions, database exceptions and form exceptions. The subclass tyically indicates the sanScript command that caused the exception. If the sanScript command that caused the exception is not known, another appropriate value, such as a table ID or script ID, is provided as the subclass.
The following tables list the classes and subclasses for system exceptions.
Class constant |
Description |
---|---|
EXCEPTION_CLASS_SCRIPT_ADDRESSING |
A referenced item isn’t currently accessible. |
EXCEPTION_CLASS_SCRIPT_BAD_TYPE |
An incompatible data type was used. |
EXCEPTION_CLASS_SCRIPT_DIVIDE_BY_ZERO |
A division by zero error occurred. |
EXCEPTION_CLASS_SCRIPT_ERROR |
A general script error occurred. |
EXCEPTION_CLASS_SCRIPT_ILLEGAL_OP |
An illegal operation was performed. |
EXCEPTION_CLASS_SCRIPT_MEMORY |
Not enough memory available to perform the operation. |
EXCEPTION_CLASS_SCRIPT_MISSING |
A referenced item is missing from the dictionary. |
EXCEPTION_CLASS_SCRIPT_OUT_OF_RANGE |
A value is outside the acceptable range. |
Class constant |
Description |
---|---|
EXCEPTION_CLASS_OBJECT_EXCEPTION |
A COM exception occurred. |
Class constant |
Description |
---|---|
EXCEPTION_CLASS_FORM_MEMORY |
There is not enough memory available to load the form. |
EXCEPTION_CLASS_FORM_MISSING |
The form is missing from the dictionary. |
EXCEPTION_CLASS_FORM_SECURITY |
Access to a form was denied by the Security global procedure. |
Class constant |
Description |
---|---|
EXCEPTION_CLASS_DB |
A general database error occurred. |
EXCEPTION_CLASS_DB_CHG_TRAN_LVL |
The transaction level was changed in a stored procedure that was called. |
EXCEPTION_CLASS_DB_DEADLOCK |
A deadlock error occurred while in a transaction. |
EXCEPTION_CLASS_DB_TRAN_IMP_ROLLBACK |
A script was terminated and left a pending transaction that was rolled back. |
For most operations, the subclass for a system exception indicates the sanScript command that caused the exception. The following table lists the constants for the common exception subclasses.
Subclass constant |
Command or operator |
---|---|
SCRIPT_CMD_ADD |
+ |
SCRIPT_CMD_SUB |
- |
SCRIPT_CMD_MUL |
* |
SCRIPT_CMD_DIV |
/ |
SCRIPT_CMD_MOD |
% |
SCRIPT_CMD_NEG |
- |
SCRIPT_CMD_POWER |
^ |
SCRIPT_CMD_EQ |
= |
SCRIPT_CMD_NEQ |
<> |
SCRIPT_CMD_LT |
< |
SCRIPT_CMD_LTEQ |
<= |
SCRIPT_CMD_GT |
> |
SCRIPT_CMD_GTEQ |
>= |
SCRIPT_CMD_NOT |
not |
SCRIPT_CMD_AND |
and |
SCRIPT_CMD_OR |
or |
SCRIPT_CMD_XOR |
xor |
SCRIPT_CMD_LSL |
<< or shiftl |
SCRIPT_CMD_LSR |
>> or shiftr |
SCRIPT_CMD_IMP |
imp |
SCRIPT_CMD_BITTEST |
bittest() |
SCRIPT_CMD_BITCLEAR |
bitclear() |
SCRIPT_CMD_BITSET |
bitset() |
SCRIPT_CMD_ADDMONTH |
addmonth() |
SCRIPT_CMD_ASK |
ask() |
SCRIPT_CMD_CALL |
call |
SCRIPT_CMD_CALLBKG |
call background |
SCRIPT_CMD_CALLSERVER |
call sproc |
SCRIPT_CMD_CHANGED |
changed() |
SCRIPT_CMD_CLEARCHANGE |
clear changes |
SCRIPT_CMD_CLOSE |
close |
SCRIPT_CMD_COUNTRECS |
countrecords() |
SCRIPT_CMD_DELETE |
delete |
SCRIPT_CMD_EDIT |
edit |
SCRIPT_CMD_EMPTY |
empty() |
SCRIPT_CMD_ERROR |
error |
SCRIPT_CMD_EXECUTE |
execute |
SCRIPT_CMD_FINDITEM |
finditem() |
SCRIPT_CMD_FIRST |
get first, change first |
SCRIPT_CMD_FOCUS |
focus |
SCRIPT_CMD_FORCECHNG |
force change |
SCRIPT_CMD_FORCECHNGCLR |
clear force change |
SCRIPT_CMD_GETSTR |
getstring() |
SCRIPT_CMD_HEXSTRING() |
str() |
SCRIPT_CMD_HIDE |
hide |
SCRIPT_CMD_ISOPEN |
isopen() |
SCRIPT_CMD_ITEMCOUNT |
countitems() |
SCRIPT_CMD_ITEMNAME |
itemname() |
SCRIPT_CMD_LAST |
get last, change last |
SCRIPT_CMD_MAX |
max() |
SCRIPT_CMD_MIN |
min() |
SCRIPT_CMD_MOVEFIELD |
move field |
SCRIPT_CMD_NATIVEFILEERROR |
naterr() |
SCRIPT_CMD_NEXT |
get next, change next |
SCRIPT_CMD_OPEN |
open |
SCRIPT_CMD_OPENEX |
open table, exclusive |
SCRIPT_CMD_PRIOR |
get prev, change prev |
SCRIPT_CMD_RANGEEND |
range end |
SCRIPT_CMD_RANGESTART |
range start |
SCRIPT_CMD_REDRAW |
redraw |
SCRIPT_CMD_RELEASE |
release |
SCRIPT_CMD_REMOVE |
remove |
SCRIPT_CMD_REPLACE |
replace() |
SCRIPT_CMD_REQUIRED |
required() |
SCRIPT_CMD_RESIZEFIELD |
resize field |
SCRIPT_CMD_RESTARTFIELD |
restart field |
SCRIPT_CMD_ROUND |
round() |
SCRIPT_CMD_RUNDELAY |
run script delayed |
SCRIPT_CMD_RUNSCRIPT |
run script |
SCRIPT_CMD_SETCURPRECIS |
set precision |
SCRIPT_CMD_SHOW |
show |
SCRIPT_CMD_STRING |
str() |
SCRIPT_CMD_THIS |
get, change |
SCRIPT_CMD_TRUNCATE |
truncate() |
SCRIPT_CMD_UNLOCK |
unlock |
SCRIPT_CMD_WARNING |
warning |
The preceding table lists the most common commands and operators that can produce exceptions. If an unlisted command has caused an exception, you can use the exception dialog that is displayed to find out more information about the command that caused the exception. The exception dialog is shown in the following illustration.
Simply scroll down to the end of the message text to see the class and subclass of the exception that was thrown.
The subclass value that is returned for database exceptions indicates the database error that occurred, rather than the sanScript statement that caused the error. The following table lists the constants that correspond to the subclass values returned for database exceptions.
DB_ERR_MEMORY |
DB_ERR_DISK_FULL |
DB_ERR_NOT_INITIALIZED |
DB_ERR_UNKNOWN |
DB_ERR_NOT_SUPPORTED |
DB_ERR_KEY_CHANGED |
DB_ERR_TOO_MANY_OPEN_TABLES |
DB_ERR_NOT_VAR_FIELD |
DB_ERR_INCORRECT_RECORD_LENGTH |
DB_ERR_CHANGED |
DB_ERR_TOO_MANY_KEYS |
DB_ERR_DEADLOCKED |
DB_ERR_TOO_MANY_SEGMENTS |
DB_ERR_PATH_NOT_FOUND |
DB_ERR_TABLE_NOT_REGISTERED |
DB_ERR_BUFFER_MISMATCH |
DB_ERR_TABLE_NOT_FOUND |
DB_ERR_COULD_NOT_CREATE |
DB_ERR_LOCKED |
DB_ERR_INCORRECT_NUMBER_OF_KEYS |
DB_ERR_BAD_FILENAME |
DB_ERR_SQL_TOO_MANY_CONNECTIONS |
DB_ERR_TABLE_NOT_OPEN |
DB_ERR_SQL_DATA_ACCESS_ERR |
DB_ERR_TABLE_NOT_EXCLUSIVE |
DB_ERR_SQL_DATA_CONV_ERR |
DB_ERR_INVALID_CMD |
DB_ERR_SQL_GENERATION_ERR |
DB_ERR_INVALID_KEY |
DB_ERR_NO_PRIMARY_KEY |
DB_ERR_EOF |
DB_ERR_SQL_NOT_LOGGED_IN |
DB_ERR_DUPLICATE |
DB_ERR_CANNOT_INIT_CTREE |
DB_ERR_MISSING |
DB_ERR_CANNOT_INIT_BTRIEVE |
DB_ERR_SET_ALREADY_ACTIVE |
DB_ERR_CANNOT_INIT_SQL |
DB_ERR_TRANS_IN_PROGRESS |
DB_ERR_SQL_OBJ_NOT_FOUND |
DB_ERR_NOT_VAR_LENGTH_TABLE |
DB_ERR_TRANS_ROLLED_BACK |
DB_ERR_TABLE_NOT_DEFINED |
DB_ERR_SQL_CONNECTION_ERR |
DB_ERR_CANNOT_LOCK_TWO_RECORDS |
DB_ERR_STILL_EXECUTING |
DB_ERR_RECORD_NOT_LOCKED |
DB_ERR_SQL_CONSTRAINT_VIOLATION |
DB_ERR_TABLE_DEF_MISMATCH |
|