Reply to Error Trapping Within Classes

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация