RE: error handling [was: ugly cvs subject]
| From: | John Coggeshall | Date: | Mon, 02 Dec 2002 15:51:32 +0000 |
| Subject: | RE: error handling [was: ugly cvs subject] | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969350101@lists.php.net to get a copy of this message | ||
I personally have no problem with using trigger_error instead of
die()... I just have an issue with not using mysql_error() because we
don't want to be flooding with SQL queries, or using some sort of
debugging logic in a reference manual
John
>-----Original Message-----
>From: Gabor Hojtsy [mailto:gabor@hojtsy.hu]
>Sent: Monday, December 02, 2002 4:18 AM
>To: john@coggeshall.org; 'Philip Olson'; 'Sara Golemon'
>Cc: phpdoc@lists.php.net
>Subject: Re: error handling [was: ugly cvs subject]
>
>
>> IMHO, I think it's the newbies' decision on how and when to use
>> functionality available in PHP. I see no problem with the
>examples in
>> the documentation reflecting the use of functionality. There are
>> countless examples in the manual currently which don't use
>what could
>> be considered "best practice", so trying to clutter things up with
>> debugging logic in this case seems unreasonable (especially
>when there
>> is still so much with poor or no reasonable documentation at all).
>
>As before, I would vote for trigger_error() insted of die(),
>because it is "future compatible". So if the programmer
>introduces a new error handler in his/her program, the errors
>are handled centrally. I also think, that using
>trigger_error() instead of die() does not increase the
>"confusion level" of one example, while introducing some if
>(DEBUG == true) would increase that... If we stick to using
>trigger_error() in the examples, users will find it first
>instead of die(), and using trigger_error() is a much better
>practice than using
>die() as it goes through PHPs error handler, so it can be logged, etc.
>
>We had a discussion on this before, but never come to a real
>decicion...
>
>Goba
>
>
>