I'm caching some objects in an admin object and I serve these cached object
up in a method, admin.getService("myService"). Some simplifed code:

<cfif NOT StructKeyExists(VARIABLES.services, ARGUMENTS.service) OR
ARGUMENTS.refresh>
        <cftry>
                <cfset VARIABLES.services[ARGUMENTS.service] = 
CreateObject("component",
"cfc.#ARGUMENTS.service#Service").init()>
                <cfcatch type="any">
                        <cfthrow type="" message="No such service: 
#ARGUMENTS.service#<br
/>#GetCurrentTemplatePath()#">
                </cfcatch>
        </cftry>
</cfif>

The try/catch is there to trap calls to service CFCs that don't exist.

admin.getService("notAService") will throw an exception:

No such service: notAService
C:\path\to\template.cfc

The trouble with the try catch is that it also traps errors in the service
object.

I've tried changing the type of the catch so I only catch the non-existent
CFC exceptions but none seem to work.

Any suggestions?

Thanks.

Adrian Lynch
http://www.halestorm.co.uk/
http://www.adrianlynch.co.uk/


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:315758
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to