Re: catch an iconv E_NOTICE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/9/24 Tom Worster <fsb@xxxxxxxxxx>:

> but i'd like proceed with default error handling in the branch with the
> question marks. how can i do that?

An error handler that passes through to the previous error handler:

<?php
error_reporting(E_ALL);

function my_error_handler($errno, $errstr, $errfile, $errline) {
    restore_error_handler();
    trigger_error($errstr, $errno);
}

set_error_handler('my_error_handler', E_ALL);

trigger_error('TEST', E_USER_ERROR);

You'll lose the file and line, though, because you're actually raising
another error with the same message at a new point in the code.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux