[cfaussie] catching a thrown error

2012-06-26 Thread Steve Onnis
If you use CFTHROW to throw errors, can you still use TRY/CATCH to catch the
error and handle it how you want to handle it?

 

I have tried but all i get is the thrown error which is not what i want to
do.  I want to throw it but then use a TRY/CATCH to catch the thrown error
and return a specific message as the result.

 

 

Steve

-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.



Re: [cfaussie] catching a thrown error

2012-06-26 Thread AJ Mercer
if you specifiy a custom type, you need to catch that type
eg


cftry
cfthrow type=myError  message=my error message detail=my error
details errorcode=500
 cfcatch type=myError
cfdump var=#cfcatch# label=catch my error expand=true /

/cfcatch
 cfcatch
cfdump var=#cfcatch# label=cfcatch expand=true /
 /cfcatch
/cftry

On 26 June 2012 15:48, Steve Onnis st...@cfcentral.com.au wrote:

 If you use CFTHROW to throw errors, can you still use TRY/CATCH to catch
 the error and handle it how you want to handle it?

 ** **

 I have tried but all i get is the thrown error which is not what i want to
 do.  I want to throw it but then use a TRY/CATCH to catch the thrown error
 and return a specific message as the result.

 ** **

 ** **

 Steve

 --
 You received this message because you are subscribed to the Google Groups
 cfaussie group.
 To post to this group, send email to cfaussie@googlegroups.com.
 To unsubscribe from this group, send email to
 cfaussie+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/cfaussie?hl=en.




-- 

*AJ Mercer*
webonix:net strength=Industrial / http://webonix.net | webonix:org
community=Open / http://webonix.org
http://twitter.com/webonix
Railo Community Manager http://www.getrailo.org/index.cfm/community/team/

-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.



RE: [cfaussie] catching a thrown error

2012-06-26 Thread Steve Onnis
Thanks. Figured it out. I was doing it in script and i had catch (e Any) but
its meant to have been catch (Any e)

 

 

From: AJ Mercer [mailto:ajmer...@gmail.com] 
Sent: Tuesday, 26 June 2012 6:32 PM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] catching a thrown error

 

if you specifiy a custom type, you need to catch that type

eg

 

 

cftry

cfthrow type=myError  message=my error message detail=my error
details errorcode=500



cfcatch type=myError

cfdump var=#cfcatch# label=catch my error expand=true
/

 

/cfcatch



cfcatch

cfdump var=#cfcatch# label=cfcatch expand=true /



/cfcatch

/cftry

 

On 26 June 2012 15:48, Steve Onnis st...@cfcentral.com.au wrote:

If you use CFTHROW to throw errors, can you still use TRY/CATCH to catch the
error and handle it how you want to handle it?

 

I have tried but all i get is the thrown error which is not what i want to
do.  I want to throw it but then use a TRY/CATCH to catch the thrown error
and return a specific message as the result.

 

 

Steve

-- 
You received this message because you are subscribed to the Google Groups
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to
cfaussie+unsubscr...@googlegroups.com
mailto:cfaussie%2bunsubscr...@googlegroups.com .
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.





 

-- 

AJ Mercer
 http://webonix.net webonix:net strength=Industrial / |
http://webonix.org webonix:org community=Open /
http://twitter.com/webonix

 http://www.getrailo.org/index.cfm/community/team/ Railo Community Manager

 

-- 
You received this message because you are subscribed to the Google Groups
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
cfaussie group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.