#32101 [Ver->Fbk]: Exception in unknown on line 0 when throwing exception inside exception handler

From: Date: Fri, 13 May 2005 11:33:51 +0000
Subject: #32101 [Ver->Fbk]: Exception in unknown on line 0 when throwing exception inside exception handler
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78977@lists.php.net to get a copy of this message
ID: 32101 Updated by: sniper@php.net Reported By: ceefour at gauldong dot net -Status: Verified +Status: Feedback Bug Type: Zend Engine 2 problem Operating System: * PHP Version: 5CVS-2005-02-15 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-02-25 11:20:24] ceefour at gauldong dot net This modified code may be better illustrate the problem: <?php function error_handler() { trigger_error("inside error", E_USER_ERROR); } set_error_handler('error_handler'); trigger_error("outside error", E_USER_ERROR); function exception_handler($exception) { throw new Exception('inside exception'); } set_exception_handler('exception_handler'); throw new Exception('outside exception'); ?> ------------------------------------------------------------------------ [2005-02-25 11:01:19] tony2001@php.net <?php function exception_handler($exception) { trigger_error("user error"); throw new Exception('exception1'); } set_exception_handler('exception_handler'); throw new Exception('exception2'); ?> ------------------------------------------------------------------------ [2005-02-25 07:12:16] ceefour at gauldong dot net Description: ------------ When an exception is thrown inside an exception handler, a "exception thrown without stack frame in unknown on line 0" message is displayed. While the meaning of this message is "clear" enough... it doesn't help at all. If you trigger_error() inside an error handler, the default error handler is triggered, but still showing meaningful/helpful error message. Exceptions inside exception handler should behave similarly. Reproduce code: --------------- // do this inside an exception handler function throw new Exception('test'); Expected result: ---------------- ...file something.php on line 483... Actual result: -------------- ...unknown on line 0.... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32101&edit=1

« previous php.bugs (#78977) next »