| Using Internet Information Server (IIS), you can trap both compilation and run-time errors that occur in your ASP page. Here's an example file that contains errors - we'll run this page in a minute and see how the errors are trapped. Test500100.asp<%@ Language=JavaScript %>
<%
// call a function that doesn't exist...
Hello ( );
// or divide by zero
var a = b / 0;
// or don't finish a statement
Unfinished (
%> |
Any of the errors in this file would cause a HTTP 500.100 error, which in turn would send a generic message back to the browser - probably the infamous "This page cannot be displayed". IIS allows you to override this default behaviour, and specify a file that will be called when an error occurs. You can specify an HTML page or an ASP page. I use an ASP page, so the site will send me an email whenever an error occurs. Don't rely on your users telling you that the site crashed! Part 2: The Handle500100.asp file... |