![]() |
![]() |
|
| Home I Company I Services I Documentation I Downloads I E-Support |
| home -> documentation -> environment guide -> Handling database exceptions | |
|
Regarding what kind of exceptions the database are raising, is a need to present to the user a clear explanation of what is happening inside the system and why he or she is violating these rules. This could be done using the TRY-ONERROR tags.
These tags works like any of the try-catch blocks found on all the recent high level programming languages. The structure is very simple:
When an exception is raised inside the TRY-ONERROR block, the block delimited by the ONERROR - /TRY is executed. This block could be used for handling the exception and present an explanation to the user or redirect to another page that contains all these explanations. Note: If an exception is raised and is not explicitly handled within a TRY-ONERROR block, then DBSP takes one of the following actions: If the DEBUGMODE parameter in the file DBSP.ini is turned on (TRUE), a template file containing detailed explanation is displayed. This template (debugerror.dbsp) is located in the bin\Templates directory inside the installation directory. If the DEBUGMODE parameter is turned off (FALSE), the production error template (productionerror.dbsp) is displayed instead.
Example 1. Managing check constraints exceptions This example shows you how trap exceptions raised by the RDBMS. Source code
|