RE: cftry/catch scoping

2002-06-07 Thread Bryan Love

I think it works like this (but I'm not positive):

custom tags operate in their own memory space - they do not share memory
space with the calling procedure.  Therefore if you want the calling
template to capture errors you'll need to somehow notify that template.  I
believe the calling template will capture errors thrown in CFINCLUDEs (since
they operate in the same memory space), so you might try that instead.

+---+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+---+

...'If there must be trouble, let it be in my day, that my child may have
peace'...
- Thomas Paine, The American Crisis



-Original Message-
From: Rob Baxter [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 9:48 AM
To: CF-Talk
Subject: cftry/catch scoping


If I have a cftry block which contains calls to custom tags, what happens if
there is an error in one of the custom tags? I would expect that the
exception would be thrown out and caught by the catch block of the cftry,
but that doesn't seem to be the case. I'm still getting untrapped errors out
of the custom tags. Can anyone confirm this, or am I doing something wrong?
CF version is 5.0 Professional.

/rob


__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: cftry/catch scoping

2002-06-07 Thread Dave Watts

 If I have a cftry block which contains calls to custom 
 tags, what happens if there is an error in one of the 
 custom tags? I would expect that the exception would be 
 thrown out and caught by the catch block of the cftry,
 but that doesn't seem to be the case. I'm still getting 
 untrapped errors out of the custom tags. Can anyone 
 confirm this, or am I doing something wrong? CF version 
 is 5.0 Professional.

You can, in fact, catch exceptions thrown by a custom tag within your
calling page. Not all errors are exceptions, though - if you have a
misspelled CFML tag in your custom tag, that will create a parsing error
which occurs before runtime, rather than a runtime exception.

In addition, the CFTRY block within your calling page has to contain CFCATCH
blocks with the appropriate types: no type specified (which is equivalent to
TYPE=ANY, more or less), TYPE=Application, or some custom type that's
thrown by the custom tag using CFTHROW.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists