Sounds like we could use a 'throwOnError' attribute for either the cffunction or cfargument tag, maybe both.
Something that works the same as the cfhttp attribute. Then you could have the wsdl specify the required parameter type and do the checking yourself in a webservice situation. Does anyone else think this would be a good idea? Spike -------------------------------------------- Stephen Milligan Code poet for hire http://www.spike.org.uk Do you cfeclipse? http://cfeclipse.tigris.org >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of Bryan F. Hogan >Sent: Thursday, June 03, 2004 9:52 AM >To: [EMAIL PROTECTED] >Subject: Re: [CFCDev] Catching Argument Type Errors > >Not in my situation. For example UPS' webservice. If you >supply a id number that is not in the correct type, it returns >to you an xml file similar to below. > ><error> > <errorCode>1</errorCode> > <errorMessage>You have supplied an invalid id >number</errorMessage> </error> > >If I had a service like below you can't return an error like >that because if you invoke this with a customerIDNumber that >is a string and not numeric the error is displayed to screen >and not caught in the method. > ><cffunction name="validateCustomerInfo" access="remote" >returntype="string" output="false"> ><cfargument name="customerIDNumber" required="yes" type="numeric"> > ><cfset var validateCustomerInfoReturn=generateError('string', 'none')> > ><cfif checkCustomerID(arguments.customerIDNumber)> > <cfset validateCustomerInfoReturn=....> <cfelse> > <cfset >validateCustomerInfoReturn=generateError('string', >arguments.customerIDNumber)> ></cfif> > ><cfreturn validateCustomerInfoReturn> ></cffunction> > > > >David Ross wrote: > >> I may be missing something, but isn't the idea behind >webservices that >> it is up to the consumer to supply the right arguments and >handle any >> errors that occur from not doing so? >---------------------------------------------------------- >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]
