|
Posted by 47computers on 09/19/06 13:48
Pretty new to PHP, I recently started learning about error trapping.
As of right now, I include the following into a page in my website:
-------BEGIN PASTE--------
error_reporting(E_ERROR | E_PARSE);
set_error_handler("SendErrorReport");
function SendErrorReport($errorNumber, $errorMessage, $errorFile,
$errorLine, $vars)
{
[code for handling the error, reporting it to the admin, etc.]
}
---------END PASTE---------
This is working great and catching everything I'd want to catch on the
page. However, it's not catching any errors that happen within a
class.
For example, the page that has this code also creates an instance of a
given class. It then calls a function on that class. Within that
function in the class's code, I would mess up a line to test the error
trapping, and it is not trapped with the above code, but instead by the
default error handling.
How should I go about also trapping the errors that occur within the
class? Any advice would be much appreciated, thank you.
-David
[Back to original message]
|