> Actually you can nest try/catch (wrap whole page, with individual code
> blocks wrapped inside of that) and its not a problem, although as you
> say its a dumb thing to do, once you know better.

Sure, you can do that. But it adds unnecessary complication to error
handling, and can cause some odd problems. For example, if you write an
exception handler that doesn't know what to do with the exception it's
caught, it should kick the exception to a higher level. If that higher level
is your page-wide exception handler, it might not be able to respond in an
especially useful manner, since it's written to deal with anything that
happens within the entire page.

> Yes indeed, but cfcatch-scope variables will tell you precisely where
> the error occurred, and why, just like you'd get with an error-scope
> message.  Pretty sure you even get a stack trace so you can drill down
> to the include or module that *really* caused the problem.

Yes, the exception itself will provide descriptive information, which is
good to have after the fact. But one of the primary purposes of exception
handling is to deal with problems as they occur, and to do this you have to
have a pretty good idea in advance of what kinds of problems you can expect.
Wrapping an entire page in CFTRY indicates that you don't actually have any
idea what's going to go wrong, and can't really do anything other than
report the exceptions it receives.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized 
instruction at our training centers in Washington DC, Atlanta, 
Chicago, Baltimore, Northern Virginia, or on-site at your location. 
Visit http://training.figleaf.com/ for more information!


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227958
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