Page 1 of 1

custom error handling

Posted: Mon Jan 07, 2008 6:06 am
by mcog_esteban
Hello all.

I'm trying to build a custom error handling class, but there's something i'm probably missing.

if i set the error_reporting to:

Code: Select all

error_reporting(E_ALL^E_NOTICE)
and inside my custom class i have:

Code: Select all

..........
switch ($errno) {
    case E_NOTICE:
            echo "Caught a Notice:";
.......
i can still catch this error although i said to report everything unless E_NOTICE's.

Any way to prevent this ? I would only like to deal with error found in the mask.

Posted: Mon Jan 07, 2008 7:31 am
by Mordred
RTSM.
It is important to remember that the standard PHP error handler is completely bypassed. error_reporting() settings will have no effect and your error handler will be called regardless - however you are still able to read the current value of error_reporting and act appropriately.

Posted: Mon Jan 07, 2008 11:46 am
by Kieran Huggins
Mordred wrote:RTSM.
:rofl: