Handle Exceptions (Compact 2013)
3/26/2014
When an exception occurs, the debugger writes an exception message to the Platform Builder Output window. Alternatively, the debugger can break execution of the program when an exception occurs, giving you an opportunity to debug it. You can manage and handle exceptions based on their type. To configure how exceptions are handled, see Configure Exception Handling.
The following procedures show you how you can handle an exception and how to continue execution after an exception.
To handle an exception
When an exception occurs, examine the results in the Platform Builder Output window, on the Output tab. The results on the Output tab indicate where the exception occurred.
If Platform Builder displays a dialog box that contains a summary of the exception, examine this information, and then click OK.
On the Platform Builder Debug menu, click Windows, and then click Call Stack. Double-click any line to display the source code corresponding to that frame.
On the Debug menu, click Windows, and then click Autos to view transient parts of the code, such as local variables.
To continue execution after an exception
In Platform Builder, click Debug, and then click Start.
If Platform Builder displays a message that asks if you want to pass the exception on to the program being debugged, click Yes to pass the exception to the program being debugged, No to pass the exception back to the kernel, or Cancel to simply leave the execution halted at the line of code that caused the exception.