heh Bad Idea(tm) I like that

> 1. Your code has errors.
There are plenty of cases where you want no indication of an error to be
shown to a user (which is exactly what a site wide error handler would
indicate), especially when the error involves uploading foreign files to
your server or your database choking on the info they tried to pass to it.
There are of course better ways to deal with both but they aren’t guaranteed
to stop any errors from being displayed like an empty cfcatch.

> 2. Your user is giving your code input that you didn't anticipate.
See above

> 3. There is an external problems, like a database being unavailable.
I doubt that skipping over an error or two, for whatever reason, would be
your biggest problem if there was no database available to your application

> There are cases where a try/catch block is
> warranted, so long as it's used properly

What is the proper use and does it exclude catching errors that might be
thrown by a cffile or cfquery?

As for wrapping cftry/catch around EVERYTHING, I missed that part. I'm not
sure how big of a performance hit that would be but it would undoubtedly be
one. Not to mention it might tend to make a lazy CF'r out of ya ;)

..:.:.:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com


-----Original Message-----
From: Justin D. Scott [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 18, 2005 10:51 PM
To: CF-Talk
Subject: RE: Using try/catch all over the place a good thing?

> I'm wrapping some cftry/catchs around my cffiles
> and cfquerys. It works pretty sweet if I use
> just an empty catch. 

Hi Will, what is sweet about it, exactly?  If your code is generating an
error, it means one of several things:


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.2/140 - Release Date: 10/18/2005
 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:221440
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to