Custom Error Handling
| From: | Adam Voigt | Date: | Mon, 08 Apr 2002 16:04:03 +0000 |
| Subject: | Custom Error Handling | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92072@lists.php.net to get a copy of this message | ||
Is there any reason the following code should not work?
I define the error function, then tell PHP to use it, then call
a function which doesn't exist (test), and it will print the error
on screen that that function doesn't exist, but it won't alert me,
so it's obviously not entering the catchError function, why?
<?php
function catchError($num, $string, $file, $line)
{
echo "<script
language=\"javascript\">alert('$num:$string:$file:$line');</script>";
}
set_error_handler("catchError");
test();
?>
Thanks for your help,
Adam Voigt
adam.voigt@cryptocomm.com