Displaying the exception...The DatabaseException function simply displays the error message using the description property of the Error object as shown below...function DatabaseException ( e )
{
Out ( 'An error has occured while connecting to the database:' );
Out ( '<p>"' + e.description + '"' );
Out ( '<p>Don\'t despair - this problem is probably well-documented in my <a href="http://CoverYourASP.com/Trouble.asp">trouble-shooting</a> section.' );
|
...then sends an email to BadDB@yourdomain.com describing the problem. I'm hoping never to get one of these emails from the CoverYourASP site! // make up the message body
var sBody = 'The file "' + sURL + '?' + Request.QueryString ( ) + '" generated a database error\n\n';
sBody += sMessage;
// send the email
SendEmail ( 'Database.Exception', 'BadDB@' + sHostDomain, '', 'Reporting exception', sBody );
}
|
|