Re: catch an iconv E_NOTICE

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

 



----- Original Message ----
> From: Tom Worster <fsb@xxxxxxxxxx>
> To: PHP General List <php-general@xxxxxxxxxxxxx>
> Sent: Thursday, September 24, 2009 6:42:29 AM
> Subject:  catch an iconv E_NOTICE
> 
> i have this hack that works up to a point...
> 
> function my_err_handler($errno, $errstr, $errfile, $errline) {
>     if ( preg_match('/iconv/', $errstr) ) {
>         throw new Exception('iconv error');
>     } else {
>         // ? how to invoke default error handler ?

http://www.php.net/manual/en/function.restore-error-handler.php

>     }
> }
> set_error_handler("my_err_handler", E_NOTICE);
> 
> try {
>     $s = iconv($enc1, $enc2, $s);
> } catch (Exception $e) {
>     // deal with the failed conversion
> }
> 
> but i'd like proceed with default error handling in the branch with the
> question marks. how can i do that?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
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