Brian, I would appreciate it if you would post your solution, once
found, to this list.  I'm interested if you choose to let CF throw the
errors for you, using typed arguments, or use non-typed args as Ray
suggested.

Personally, I would choose to use typed arguments.  It also helps to
document your components.  It's not very beneficial to see an unknown
data type as an argument.

If you wanted to get deep into it, I guess you could always call a
"wrapper" component that takes, as arguments, the method you eventually
want to call as well as a return structure in case you expect anything
from the method.  That would get messy and I would only want to do it as
an exercise.

M!ke 

-----Original Message-----
From: Bryan F. Hogan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 03, 2004 11:11 AM
To: [EMAIL PROTECTED]
Subject: [CFCDev] Catching Argument Type Errors

Can someone tell me how if it is possible to catch argument type errors?

For example:

<cffunction name="test" access="public" returntype="numeric"
output="false"> <cfargument name="testValue" required="yes"
type="numeric">

<cfset var testReturn=(arguments.testValue*10)>

<cfreturn testReturn>
</cffunction>

If invoke it like:

<cfdump var="#test('test')#">

I don't want my error handler thrown. I want to catch that error within
the component, pass it to another component to log it and/or display a
friendly error.

Is there a way to catch argument type errors?
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool,
Corporation (www.mindtool.com).

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


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

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

Reply via email to