Highlighted

HELP:Catching Exceptions from ColdFusion in Flex

Avatar

12-02-2009

Straight to the point;

I have a webservice calling a CFC, all is well in all my
other webservices so I know that I'm not doing anything wrong in
the call itself. However, in one of my CFC functions I throw an
exception; which my fault handler method in flex acknowledges. The
problem is, REGARDLESS OF WHICH PROPERTY I ACCESS I ALWAYS GET A
GENERIC ERROR MESSAGE!

I tried faultString, faultDetail, faultCode, and a slew of
others. I never seem to get the exception verbiage that I threw in
ColdFusion! Help please.

Following is the CFC code and the Flex code.






The CF Code that throws the exception

<cfif IsDefined(SESSION.CLIENT.boolClientLoggedIn)>

<cfif SESSION.CLIENT.boolClientLoggedIn eq "true">

<cfthrow message="Attempting to call fncClientWebSignup
when client is logged in.">

</cfif>




The Webservice Call

<mx:WebService id="cfc_Client"

useProxy="false"

wsdl="
http://xxx.xxx.xxx.xxx/_xxx/cfc_xxx.cfc?wsdl"

showBusyCursor="true">

<mx:operation name="fncClientWebSignup"
result="handleWebSignupResult(event)"
fault="handleUserSignupUpFault(event)"/>

</mx:WebService>

Replies

Highlighted

Avatar

Avatar

tietack

Avatar

tietack

tietack

08-05-2009

I am having my own issues with exceptions from my CFC. My fault handler is never being triggered. But as to your issue, check out the following blog post. It maps the cfthrow properties to their respective Fault event properties.

http://www.brucephillips.name/blog/index.cfm/2008/4/27/Handling-ColdFusion-Custom-Exceptions-In-Flex

Hope this will help you display more clear error messages.

--Jamee