Re: Re: custom error handling
| From: | electroteque | Date: | Wed, 08 Jan 2003 11:32:23 +0000 |
| Subject: | Re: Re: custom error handling | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130754@lists.php.net to get a copy of this message | ||
actually its getting there
$backtrace = debug_backtrace();
foreach ($backtrace as $val) {
if (eregi($val['function'],'query')){
echo $val['file']."<br>";
echo $vale['line']."<br>";
}
}
"Michael Sims" <mhsims@midsouth.rr.com> wrote in message
news:eglm1v00o46c0jv3dv02opsf5eof0ag4dl@4ax.com...
On Wed, 8 Jan 2003 08:28:58 +1100, you wrote:
>> hi there i am trying to build a ustom error handler for the pear db
aswell
>> as catch fatal and parse errors , unfortunatly the pear db error message
>> wont give me back the file and the line where the error is, how can i
>> determine the line and file where the error is caused ufortunatly the
>> callback funtion with the params $errfile and $errline return the file
>that
>> contains the trigger not the script itself !
If you're running PHP 4.3.0 use debug_backtrace() inside your custom
error handler to trace the error. If you're not running PHP 4.3.0
consider upgrading, because debug_backtrace() is a lifesaver.