Error Messages

Commerce Server Business Desk uses a centralized set of friendly error messages for use by all Business Desk modules. These error messages are used for errors encountered within the Business Desk module code, and not in response to HTTP errors. Typically, modules also define their own, unique error messages for use where no shared friendly error message will suffice.

Friendly error messages are passed to the routines SetError and ShowErrorDlg as a text string (in the strFriendlyError parameter).

Server-side friendly error messages are available through a MessageManager object, initialized on application start-up (Global.asa), and then placed in the Application object. Client-side friendly error messages are available through the XML Document Object Model (DOM), added to it when the Business Desk Framework initializes. Using these mechanisms, all module writers have access to the same set of shared error messages.

In addition to both centralized and private friendly error messages, the routine that displays errors can also include detailed information. The detailed information is initially hidden in the error dialog box, but can be shown by clicking the Details button.

Detailed error information is passed to the routines SetError and ShowErrorDlg as a string containing pre-formatted HTML (in the strErrorDetails parameter). If the strErrorDetails parameter is found to be empty, then no Details button is displayed in the dialog box.

The HTML formatting typically specifies a small table with two columns containing a name and value, respectively.

There are a number of client-side and server-side error formatting routines, designed to translate a variety of error objects into a corresponding HTML table. For example, the sGetScriptError client-side routine formats the contents of the global VBScript Err object into an HTML table, and returns it as a string.

The Business Desk Framework provides the following two client-side and four server-side error formatting routines, useful for formatting ADO, ASP, VBScript, and XML Parse errors.

Server-side error formatting routines:

sGetADOError (server-side) sGetScriptError (server-side)
sGetASPError (server-side) sGetXMLError (server-side)

Client-side error formatting routines:

sGetScriptError (client-side) sGetXMLError (client-side)

The server-side routine SetError caches its parameters in the Session object, where they are displayed on the client the next time one of the taskbar insertion routines is called. The SetError routine also appends the error to the Microsoft Windows NT Event Log.

Business Desk handles HTTP errors differently, displaying a custom error page. This page contains the original Internet Information Services (IIS) error text, but it is presented in a page that is branded with a Business Desk image. By default, all HTTP "page not found" and "access denied" errors reported by IIS are handled in this standard way.

HTCs gracefully handle XML configuration inputs with missing attributes or tags. If an HTC encounters an error when initializing due to malformed XML, the control will not display and a standard message stating "The control could not load. Please contact your system administrator" will be displayed in a standard message box. There will also be a button that allows the user to see the details of the XML error that caused the control failure.

Data validation error checking is typically performed, and appropriate errors displayed, within the HTCs being used to edit the data. Additional validation error messages, such as for cross-field validation, should display using the standard MsgBox function in the Internet Explorer Document Object Model (DOM).

The ListSheet HTC expects errors returned from fetch pages to be encoded in error nodes by the AddErrorNode routine in the file HTTPXMLUtil.asp. The ListSheet HTC will then automatically display these errors in a dialog.


All rights reserved.