Here is a template I toss into all of my apps. Its called "error.cfm". 
I use this tag by encapsulating the whole index.cfm template with a
CFTRY/CFCATCH, as follows:
<CFTRY>
{the CFSWITCH}
<CFCATCH TYPE="Any">
        <CFINCLUDE template="Error.cfm">
</CFCATCH>
</CFTRY>

And then, here is the actual "Error.cfm" file...
<!----------- START of ERROR.CFM. Copy the stuff below here and the END tag,
and save as "error.cfm" ------------------>
<!-- error.cfm -->
<!---
|| I will display an error page filled with info captured from the
CFTRY/CFCATCH process. I will send an e-mail to [EMAIL PROTECTED]
containing the same info.

|| [EMAIL PROTECTED]

||
--> CFCATCH.() : Variety of info on the generated error. View the code to
get an idea of the various items scoped into the CFCATCH context.
+++ dsp_debug.cfm
||FUSEDOC--->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
        <title>Error Occured - Ugh !</title>
</head>
<body bgcolor="white">
<h2>Go figure, an error occured.</h2>
<p><p>
The error information has been captured and e-mailed to Alan McCollough for
debugging purposes.
<p><p>
<CFOUTPUT>
<!--- and the diagnostic message from the ColdFusion server --->
<P>#CFCATCH.message#</P>
<hr>
#CFCATCH.detail#
<hr>

<hr>
<P>Caught an exception, type = #CFCATCH.TYPE# </P>
<P>The contents of the tag stack are:</P>
<CFLOOP index=i from=1 to = #ArrayLen(CFCATCH.TAGCONTEXT)#>
<CFSET sCurrent = #CFCATCH.TAGCONTEXT[i]#>
<BR>#i# #sCurrent["ID"]# 
(#sCurrent["LINE"]#,#sCurrent["COLUMN"]#) #sCurrent["TEMPLATE"]#
</CFLOOP>
<hr>
<H2>Client Variable List:</h2><br>
#GetClientVariablesList()#
<hr>
</CFOUTPUT>
<HR>
<cfmail to="[EMAIL PROTECTED]"
from="[EMAIL PROTECTED]"
subject="ERROR OCCURED - {put your app's name HERE so you know which app
threw the error.}"
type="HTML">
<P>#CFCATCH.message#</P>
<hr>
#CFCATCH.detail#
<hr>
<P>Caught an exception, type = #CFCATCH.TYPE# </P>
<P>The contents of the tag stack are:</P>
<CFLOOP index=i from=1 to = #ArrayLen(CFCATCH.TAGCONTEXT)#>
<CFSET sCurrent = #CFCATCH.TAGCONTEXT[i]#>
<BR>#i# #sCurrent["ID"]# 
(#sCurrent["LINE"]#,#sCurrent["COLUMN"]#) #sCurrent["TEMPLATE"]#
</CFLOOP>
<hr>
<H2>Client Variable List:</h2><br>
#GetClientVariablesList()#
<hr>
<P>CGI.HTTP_AUTH_USER: #CGI.HTTP_AUTH_USER#</P>
<CFIF IsDefined("Cookie.CFID") AND IsDefined("Cookie.CFTOKEN")>
<P>CFID:CFTOKEN = #Cookie.CFID#:#Cookie.CFTOKEN#</P>
</cfif>
</cfmail>
</BODY>
</html>
<!-------------END ---------------------->

Alan McCollough
Web Programmer
Allaire Certified ColdFusion Developer
Alaska Native Medical Center

> -----Original Message-----
> From: Ben Lowndes [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, September 06, 2000 4:17 AM
> To:   [EMAIL PROTECTED]
> Subject:      RE: Stumped on the "new" FB
> 
> 
> Another, off-topic question:  how can I get the results of an error
> message
> emailed to me from a CFCATCH tag, so I can monitor a site?  I can't find a
> "variable" that might contain the error text in the CF Documentation.
> 
> There are lots of variables returned by CFCATCH depending upon the catch
> type...
> 
> The 2 I use for emailling myself the error is CFCATCH.Message and
> CFCATCH.Detail
> 
> Be sure to set the cfmail type to HTML as CFCATCH.Detail creates an HTML
> format message.
> 
> Ben
> 
> --------------------------------------------------------------------------
> ----
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to