O'Reilly logo

ASP in a Nutshell, 2nd Edition by A. Keyton Weissinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ASPError Example

The following script could be used as a custom version of 500-100.ASP. It demonstrates several of the items discussed in this chapter and others.

From the user's perspective, this script simply informs him or her that an error has occurred, that the developers of the application have been notified, and that the user should try his or her action again later. It also provides a number that the user can call for support. In the background, however, this script creates a mail message containing information about the offending error, the state of the application and about the specific user who was attempting the action in the application. This mail message is then routed to a developer mailbox.

Note that you could add more sophistication to the routing mechanism that could, for example, look up the appropriate recipient based on the script title. Also, you may want to log these error messages in a database for later review.

<%@ LANGUAGE="VBSCRIPT" %> <% Response.Buffer = TRUE Response.Expires = 0 ' Script Name: 500-100_Custom.ASP ' Description: This script catches the last error and ' creates and sends a message via email ' to the responsible developer. ' Inputs: Will take whatever information was previously ' submitted into the error-raising script. ' Author: Keyton Weissinger ' Change Log: ' Date Programmer Notes ' --------------------------------------------------- ' 3/24/2000 AKW Created script. ' *** Dimension local variables needed for script. *** ' Vars for user ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required