I haven't had a problem with it. I use a custom tag that captures anything
passed to it, makes a wddx packet, logs it, and emails me a link to that
tansaction. When I go it, I cfdump the wddx for display and diagnostic
purposes. Out side the CT, I pass in cfcatch, which is then WDDXed inside
the CT.
Here is a glimpse of the CT guts!
<cfparam name="attributes.allVars" default="NONE">
<CFWDDX action="CFML2WDDX" input="#attributes.allVars#" output="WDDXPACKET">
<!---Auditing all requests by capturing and storing attribute vars into
serialized WDDX packet.--->
<cfif isWDDX(WDDXPACKET)>
<!-----Performing dB insert------>
<cfstoredproc datasource="#attributes.DSN#" procedure="spAppAudit">
<cfprocparam type="In" cfsqltype="CF_SQL_BIGINT"
value="#attributes.USERID#" null="NO">
<cfprocparam type="In" cfsqltype="CF_SQL_LONGVARCHAR"
value="#WDDXPACKET#" null="No">
<cfprocparam type="Out" cfsqltype="CF_SQL_BIGINT"
variable="auditRecordID" null="No">
</cfstoredproc>
</cfif>
<!---END OF AUDIT------>
Then I return the AuditID for the email.
Justin
-----Original Message-----
From: Jeff Battershall [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 10:36 AM
To: [EMAIL PROTECTED]
Subject: RE: [CFCDev] Error Handling Best Practices - response to RE:
[CFC Dev] Error Handling Strategies
Stephanie,
Thanks a bunch. One thing I also wanted to do was capture the arguments
scope as a WDDX packet for purposes of diagnostics, but WDDX chokes on this
frequently. I think it may have something to do with boolean values.
Anyone experience this and have a solution/workaround? Is this a known bug?
Jeff
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of St�phane Bisson
Sent: Thursday, July 10, 2003 7:26 AM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] Error Handling Best Practices - response to RE: [CFC
Dev] Error Handling Strategies
Jeff,
Here's what I'm doing to control any errors in our Flash site. ColdFusion
CFC Method is always returning Query to Flash and it uses the cftry/cfcatch.
So if an error occured, it will go to the cfcatch "database" or "any". In
each cfcatch, I'm creating a new query with two column called "status" and
"error_message". I make status=e and error_message="An error has occured.
Sorry about it, someone is already advice of the problem and he's working on
it" and I'm using a CFC method to advice the support group. Every time
Flash has to check to see if the FIRST row has the field status=e and if
it's the case, it displays the error_message text to the user. Otherwise it
reads the query has normal.
Hope it will help you
Stephane
here's an cfcatch example:
<cfcatch type="Database">
<<<!--- Call the Error Handling passing good information to the support
group that will received the error exception --->
<cfif not IsDefined("error_param")>
<cfset error_param = ArrayNew(1)>
</cfif>
<cfset abend_message = ErrorHandling.ErrorDB(
ARGUMENTS.in_callername,
ARGUMENTS.in_language_cd,
cf_template,
cf_function,
query_name,
CFCATCH.DETAIL,
CFCATCH.SQLSTATE,
query_tables,
CFCATCH.TAGCONTEXT,
query_detail,
error_param
)>
<!--- If an error has occured, recreate the return query
variable and create
the first row with a status of error (e) and an
appropriate message--->
<cfset UpdateMovieTextOut = QueryNew("status, error_message")>
<cfset temp =
QueryAddRow(UpdateMovieTextOut, 1)>
<cfset temp =
QuerySetCell(UpdateMovieTextOut, "status", 'e', 1)>
<!--- The abend_message variable is coming from the template
ErrorDB.cfm or ErrorAny
to give to flash in the proper language something to
display to the user --->
<cfset temp =
QuerySetCell(UpdateMovieTextOut, "error_message", abend_message, 1)>
</cfcatch>
----- Original Message -----
From: "Chris Kief" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 09, 2003 5:06 PM
Subject: RE: [CFCDev] Error Handling Best Practices - response to RE: [CFC
Dev] Error Handling Strategies
Jeff,
>From what I've found...no. The cferror tag doesn't work so a global
>error
handler seems out of the question. You end up with try / catch in every CFC
method.
Remoting really needs a better way to handle things. CF is great at making
things simple...this should be no different.
In Flash I usually setup an error manager that responds to onStatus events
and notifies the user of what's up. If I could just throw my own onStatus
events from CF, say from a global error template invoked by a working
cferror tag, then I could respond gracefully on the client end of things
while dealing with logging and admin notification on the server side.
chris
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>Behalf Of Jeff Battershall
>Sent: Wednesday, July 09, 2003 12:47 PM
>To: [EMAIL PROTECTED]
>Subject: RE: [CFCDev] Error Handling Best Practices - response to RE:
>[CFC Dev] Error Handling Strategies
>
>Thanks Ray. And thanks to everyone else who replied. But there's no way
>to "globally" or "automatically" or "auto-magically" capture the errors
>as such, right? I don't think there is but I'm just checking to see if
>I've missed something.
>
>What happens in situations where the CFC method is supposed to return a
>query, but when an exception is thrown, a struct is sent back? Only
>way I could see would be to set returntype to "any" in every method.
>Does that create overhead due to Flash having to evaluate the returned
>object type?
>
>Jeff
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>Behalf Of Raymond Camden
>Sent: Wednesday, July 09, 2003 2:34 PM
>To: [EMAIL PROTECTED]
>Subject: RE: [CFCDev] Error Handling Best Practices - response to RE:
>[CFC Dev] Error Handling Strategies
>
>
>I also use a custom throw in my cfc. This allows me to set ONE type for
>the entire CFC and just do this in various methods,
>
><cfset throw("You screwed up you dog-faced idiot!")>
>
>
>=======================================================================
>=
>===
>Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
>(www.mindseye.com)
>Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)
>
>Email : [EMAIL PROTECTED]
>Blog : www.camdenfamily.com/morpheus/blog
>Yahoo IM : morpheus
>
>"My ally is the Force, and a powerful ally it is." - Yoda
>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
>> Behalf Of Justin Balog
>> Sent: Wednesday, July 09, 2003 1:30 PM
>> To: '[EMAIL PROTECTED]'
>> Subject: FW: [CFCDev] Error Handling Best Practices - response to RE:
>> [CFC Dev] Error Handling Strategies
>>
>>
>> Howdy,
>>
>> Concerning Error handling, Sean C. sent this reply to my question
>> (his email follows below these code samples of mine), and I have run
>> with it. I do wrap the the methods of the cfcs, and the facade cfcs
>> to catch errors, but on error I call a private method in the cfc
>> "throw()" which handles the exception by calling various other cfcs
>> to log it, notify someone, retry, whatever? There is probably a
>> better way to do it, but this is how I am currently handling it.
>>
>> Excerpt from a cfc called by the facade cfc:
>>
>
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email
>to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
>in the message of the email.
>
>CFCDev is run by CFCZone (www.cfczone.org) and supported
>by Mindtool, Corporation (www.mindtool.com).
>
>
>
>
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email
>to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
>in the message of the email.
>
>CFCDev is run by CFCZone (www.cfczone.org) and supported
>by Mindtool, Corporation (www.mindtool.com).
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).