Re: catch an iconv E_NOTICE
| From: | David Otton | Date: | Thu, 24 Sep 2009 14:30:03 +0000 |
| Subject: | Re: catch an iconv E_NOTICE | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-298315@lists.php.net to get a copy of this message | ||
2009/9/24 Tom Worster <fsb@thefsb.org>:
> 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.