cftry/cfcatch error handling

2004-08-30 Thread Andrew Grosset
I have a template which calls a custom tag (data.cfm). For testing puposes I deliberately caused an error to occur within the custom tag, the cfcatch/cftry block responds with any text I have written within the cftry tags but #cfcatch.message# is emptyIf I cause an error to occur within the template that calls the tag (using url.test) then the catch.message is not empty.anyone have any thoughts on how to handle errors when using custom tags?




  

  


Testing 123..


An error has occurred...

cfcatch message=#cfcatch.message#





Andrew.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: cftry/cfcatch error handling

2004-08-30 Thread Spike
What sort of error were you creating in your custom tag?

If it's an error that occurs when the server tries to compile the code from
CFML to Java then the try/catch won't do anything. If it's an error that
occurs because of a runtime error such as a non-existant variable then it
should catch the error.

A simple way to check would be to add this to an otherwise good custom tag:



If you get that output on the page you probably had a compile time error in
the custom tag.

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 Andrew Grosset
>Sent: Monday, August 30, 2004 9:05 PM
>To: CF-Talk
>Subject: cftry/cfcatch error handling
>
>I have a template which calls a custom tag (data.cfm). For 
>testing puposes I deliberately caused an error to occur within 
>the custom tag, the cfcatch/cftry block responds with any text 
>I have written within the cftry tags but #cfcatch.message# is 
>emptyIf I cause an error to occur within the template that 
>calls the tag (using url.test) then the catch.message is not 
>empty.anyone have any thoughts on how to handle errors 
>when using custom tags?
>
>
>
>
>  
>
>  
>
>
>Testing 123..
>
>
>An error has occurred...
>
>cfcatch message=#cfcatch.message#
>
>
>
>
>
>Andrew.
>
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: cftry/cfcatch error handling

2004-08-31 Thread Andrew Grosset
Thanks Spike, I got it working now !

Andrew.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]