Re: error reporting for PHP5

From: Date: Mon, 25 Nov 2002 13:59:37 +0000
Subject: Re: error reporting for PHP5
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-91521@lists.php.net to get a copy of this message
Sorry to jump in the middle of a conversation, but I just wanted to say that I personally use trigger_error() quite often.
Me too, I use it for warnings, notices, and errors that cannot be remedied. In my programs I also simulate custom error codes. The first part of the error string looks something like "[error.code] Message" and I parse this later and act upon it.
The site I maintain has a nice custom error handler which logs the error and emails the admins the error details + var dumps, etc.
Absolutely.
I often use trigger_error() in my code because it allows me to treat certain situations the same as a PHP generated error. Of course, I suppose I could just call my custom error handler directly but that seems less elegant...just MHO.
The way with trigger_errors is better because you can at any time turn the custom error handler off, and everything would still work. Bye, Ivan

« previous php.dev (#91521) next »