#32101 [Com]: Exception in unknown on line 0 when throwing exception inside exception handler

From: Date: Sat, 30 Jul 2005 21:57:50 +0000
Subject: #32101 [Com]: 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-82726@lists.php.net to get a copy of this message
 ID:               32101
 Comment by:       james at academicsuperstore dot com
 Reported By:      ceefour at gauldong dot net
 Status:           No Feedback
 Bug Type:         Scripting Engine problem
 Operating System: *
 PHP Version:      5CVS-2005-02-15
 New Comment:

I am experiencing the same problem using 5.0.4.


Previous Comments:
------------------------------------------------------------------------

[2005-05-21 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2005-05-13 13:33:49] sniper@php.net

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




------------------------------------------------------------------------

[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


Thread (13 messages)

« previous php.bugs (#82726) next »