Contents Index Writing scripts to handle errors Handling multiple errors on a single SQL statement

MobiLink Synchronization User's Guide
  Writing Synchronization Scripts
    Writing scripts to handle errors

Reporting errors


Since errors can disrupt the natural progression of the synchronization process, it can be difficult to create a log of errors and their resolutions. The report_error script provides a means of accomplishing this task. The MobiLink synchronization server executes this script whenever an error occurs. If the handle_error script is defined, it is executed immediately prior to the reporting script.

The parameters to the report_error script are identical to those of the handle_error script, except that the report_error script can not modify the action code. Since the value of the action code is that returned by the handle_error script, this script can be used to debug error-handling problems.

This script typically consists of an insert statement, which records the values, perhaps with other data, such as the time or date, in a table for later reference. To ensure that this data is not lost, the MobiLink synchronization server always runs this script in a separate transaction and automatically commits the changes as soon as this script completes.

For more information, see report_error connection event.

Example 

The following report_error script, which consists of a single insert statement, adds the script parameters into a table, along with the current date and time. The script does not commit this change because the MobiLink synchronization server always does so automatically.

INSERT INTO errors
VALUES( CURRENT DATE, ?, ? ,?, ?, ? );

Contents Index Writing scripts to handle errors Handling multiple errors on a single SQL statement