Here is a little function I use to send myself error messages -
arguments.exc is the exception structure that the onError method receives -
I pass it through to an Error.cfc.
<cfsavecontent variable="content">
<h2>Error Report: #DateFormat(Now(),"long")#,
#TimeFormat(Now(),"long")#</h2>
<h3 style="color:red;" id="errormessage">#arguments.exc.message#</h3>
<h4 style="color:blue;" id="errorlocation">The error occurred in
#arguments.exc.TagContext[1].template#</h4>
<p id="errordetail">#arguments.exc.detail#</p>
<!--- loop tagcontext to extract template and line information --->
<cfloop from="1" to="#ArrayLen(arguments.exc.TagContext)#" index="i">
<span id="tagcontext_#i#">#arguments.exc.TagContext[i].Template#,
Line #arguments.exc.TagContext[i].Line#</span><br>
</cfloop>
</cfsavecontent>
-- Josh
----- Original Message -----
From: "Michael Brennan-White" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Thursday, July 31, 2008 1:17 PM
Subject: How do I extract Error Information from Structure?
> My error function sends me error information through email. In addition I
> would like to place this information into a database table to track the
> number of times the error happens and indicate when the error is resolved.
>
> Error (struct)
> - TagContext (struct)
> - error (array)
> -Error (struct)
> column
> line
> template
>
> For expression type errors, there is a structure named tagcontext which
> has an array named error which has a structure named error. The column,
> line and template values are what I am trying to insert into the database
> (among other fields). How would I access these items?
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:310033
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4