pear error handler
| From: | electroteque | Date: | Mon, 06 Jan 2003 20:36:09 +0000 |
| Subject: | pear error handler | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-3200@lists.php.net to get a copy of this message | ||
hi guys i set a pear error handler callback function like so
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'handle_pear_error');
function handle_pear_error ($error_obj) {
$error_string = $error_obj->getMessage() . '<br>' .
$error_obj->getDebugInfo();
trigger_error ($error_string, E_USER_ERROR);
}
what exactly is the value of userinfo so i will pass me back the correct
page and lines, the documentation isnt so good as to say what exactly
userinfo is ?? the only thing it tells me is that is set to NULL .whenever i
getMessage it also returns the script where i have put trigger_error
($error_string, E_USER_ERROR); which is the include script, not the actual
script with the error ?
here is my output at the moment
In /www/servers/electroteque/web/galleries/includes/include_top.php, line:
30
DB Error: syntax error
SELECT gallery FROM galleries WHERE galleryID= [nativecode=1064 ** You have
an error in your SQL syntax. Check the manual that corresponds to your MySQL
server version for the right syntax to use near '' at line 1]
i'd like to be able for it to say "In something.php line 100" , so then i
can get the line number read the script to that line and be able to get 3
lines before and after and show that code also in the output.