Tutorial 7: Implementing the JSAPI to catch exceptions with an error callback function
This tutorial provides step-by-step instructions for authoring a web page to catch exceptions and test them by generating a specific error to trigger the exception handler. Write an errorHandler function to catch exceptions in a web page.
1 Using a code editor, open or create a BasicViewer.html file that contains a basic implementation of the viewer.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
If you receive a security warning that Internet Explorer has restricted this page from running scripts or ActiveX controls that could access your computer, right-click on the message and select Allow Blocked Content.
6 Open basicexception.html. The errorHandler function runs because no login credentials have been provided, as shown in Figure 16‑3.
Figure 16‑3 Authentication message from errorHandler