You might make it a bit more flexible by using methods such as:
setErrorFromCFCatch(cfcatch)
setError(error msg, error field, error detail)
setErrorFromStruct(struct)

Then, no matter which method you call, the error object will always
store the errors in the same format for later retrieval.

M!ke 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Daniel Short
Sent: Tuesday, March 15, 2005 12:42 AM
To: [email protected]
Subject: RE: [CFCDev] Using Error Handling Objects

<cftry>
        <!--- check for duplicate email address --->
        <cfif DupEmail()>
                <cfthrow type="validation" message="Dup Email"
detail="Duh man..." errorCode="emailAddress">
        </cfif>
        <cfcatch type="validation">
                <cfset errObj.setError(cfcatch)>
        </cfcatch>
</cftry>

Does that sound like a valid solution? Then my errObj gets to decide how
to deal with the cfcatch structure.

Dan

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]

Reply via email to