Most of my functions in the CFC return's an object
(Struct) that has both the 'code' and 'message' apart
from the other details you need.

Here's an example

<cfcomponent ..


  <cffunction name="getQuery"  hint=""  
returntype="struct" access="remote"    >

        <cfargument  type="struct"      name="stData" 
required="yes"  >

        <cfset var retStruct = StructNew()>

        <cfset retStruct['code']        = 0 >
        <cfset retStruct['message']     = "Message from Function
getQuery: " >
                
        <cftry>
                        <cfquery name="qry_getqry" datasource="#dsn#">
                                your query
                        </cfquery>

                <cfset retStruct['dpCustomQuery']               =
queryToArray(qry_getqry) >
                <cfset retStruct['code']                                        
=  100 >
                <cfset retStruct['messaage']                                    
= 'Custom query
data retrieved successfully' >  
                
                <cfcatch type="any">
                        <cfset retStruct['message'] = "Error Details :" &
retStruct['message'] & cfcatch.Message & " " &
cfcatch.Detail >
                </cfcatch>
        </cftry>
        
        <cfreturn retStruct >
        
  </cffunction>

</cfcomponent>

In your Flex code , you will always get 'code' and
'message' in your 'result' object and you can process
your code based upon the 'code' you receive.


Hope this helps.
Mohanraj










--- Greg Johnson <[EMAIL PROTECTED]> wrote:

> Right now, when something goes caput in a cfc I get
> back a realitivly 
> meaningless set of information in Flex vs and CFML
> doc calling the same 
> CFC and getting an error.
> 
> 
> 
> 



                
__________________________________________ 
Yahoo! DSL – Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to