version 1.5
OC SET ERROR HANDLER (methodName)
| Parameter | Type | Description | |
| methodName | String | Name of error handling method |
Description
The OC SET ERROR HANDLER command installs an error handling method that is executed each time an error occurs. This enables you to control possible execution errors and override the default error handling.
methodName is the name of the method to install.
To return to the default behavior, pass an empty string such as OC SET ERROR HANDLER("").
4D ODBC will pass five arguments to your method:
| Parameters | Type | Description |
| $1 | Longint | Error number |
| $2 | Longint | Error level |
| $3 | Text | Description of the error |
| $4 | Longint | 4D process ID |
| $5 | String | SQL Status of the error |
To compile your database, you must declare the $1 to $5 variables using the C_LONGINT and C_TEXT commands.
By default, if no error handling method is installed, all errors are intercepted by 4D ODBC and an alert is displayed describing the error.