Re: Exceptions: How much is too much.
| From: | Craige Leeder | Date: | Sun, 07 Jan 2007 18:17:23 +0000 |
| Subject: | Re: Exceptions: How much is too much. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-246702@lists.php.net to get a copy of this message | ||
Thanks.
Does anybody else have any input? Not to be pushy, but I'm in the
middle of programming a framework for a site.
- Craige
On 1/5/07, Paul Scott <pscott@uwc.ac.za> wrote:
On Fri, 2007-01-05 at 00:44 -0500, Craige Leeder wrote: The question is: How much is too much. Should I use Exceptions to handle all of my error reporting/triggering? How about catching them? I mean, if I'm using Exceptions for all of my error handling, I could easily end up wrapping my entire script in a try block(or at least having almost all my end-code within a number of them). Not sure if I am doing it correctly either, but, what I do is use try/catch blocks to instantiate all of the objects that I need and then let the script take over. I also use exceptions to handle SQL errors in my db abstraction object(s). That way, only real messes are caught and the script then displays a graceful exit page to the user instead of screen vomit that may scare them off. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm