Error Handling with the AJAX Toolkit

The AJAX Toolkit provides the ability to handle errors for synchronous and asynchronous calls.

If the API call fails, then the AJAX Toolkit throws an exception. The exception contains all the available error information. For example:

For asynchronous calls, the onFailure property of the asynchronous object is called. For example:

If the onFailure property was not defined, the AJAX Toolkit pops up a new read-only browser window showing the error.