> Lets say something gets by all my validation and a bad 
> variable makes it to a query in a CFC method. Now I have an 
> error. So I put a try catch around the query to control the 
> errors in the CFC. Since I need the results from the CFC 
> query, I'll get an error on the page calling it because the 
> page didn't receive a query. I got a thrown error message 
> instead. Now I need to check to see if I'm getting an error 
> or a query and use a few more try catches.

Just an opinion this... But that kind of error I don't want to catch...
I'd rather throw it or rethrow it all the way up to my global <cferror
type="exception" exception="any" /> handler and get it to email me the
details rather than display a nice message to the user saying the
database insert failed (obv they would still get a nice display tho). 

Would that not be an application error at that point and not a user
error?  That's the way I am doing it the now. There are exceptions to
this rule I imagine but none that I come across in my code.

I just figure if it got past my (paranoid) validation, then I want to
know about the error cos there is a hole in my code!  Obviously
everything is protected against injection attacks and the likes with
cfqueryparam and variable scrubbing...

Not sure if this is best practise but working for me at the moment.
Always open to suggestions tho :)

Cheers

-- 
dc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197906
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to