Re: best practices in error handling in PHP
| From: | It Maq | Date: | Wed, 12 Mar 2008 14:47:34 +0000 |
| Subject: | Re: best practices in error handling in PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-271366@lists.php.net to get a copy of this message | ||
Yes you are right i can use trigger_error that will use the function that handles errors from my
class.
Thanks
----- Original Message ----
From: Christoph Boget <christoph.boget@gmail.com>
To: It Maq <itmaqurfe@yahoo.com>
Cc: php-general@lists.php.net
Sent: Wednesday, March 12, 2008 10:31:07 AM
Subject: Re: [PHP] best practices in error handling in PHP
> I want to know what is the best solution for handling errors. After reading some
> documents dealing with the subject, i have three options:
> * Using a class for error handling
> * Using PEAR error object
> * Using try and catch exceptions
> The error handling i want to implement will be done in a big application that was
> developed from the beginning without any concern about error handling.
It seems to me that 1 and 3 aren't necessarily mutually exclusive. I
believe that you can use your own error classes in php's try/catch
functionality. As for PEAR's error object, unless you are using PEAR
elsewhere in your app I'm not sure it would be worthwhile to just use
this very small piece.
This is all just IMO.
thnx,
Chris
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping