KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Error handling
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: April 2, 1999
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

You may have seen the two-part error alert that says, "Error: (description). Action: (result)." Did you know that when this occurs, the code for the entire process is aborted? The remaining code in the process never runs. You can demonstrate this by setting the memory on your copy of 4D to the minimum required, and running the following code:

ARRAY STRING(255;aHugeArray;32000)
ALERT("The remaining code.")

4D can't be sure of what the consequences of continuing to run the remaining code would be, so instead of risking the integrity of your data, it aborts the code execution.

If you would prefer that your code not be prematurely aborted, you can institute your own error handling. To do this, you need to use the ON ERR CALL command to install your own error handling method in each process, and write your code so that it checks for error conditions and responds appropriately. When you have a custom error handling method installed, 4D continues the code execution after an error. It then becomes the developer's responsibility to write the code to handle the consequences.