Edit report at http://bugs.php.net/bug.php?id=32101&edit=1

 ID:               32101
 Comment by:       rjonbone at gmail dot com
 Reported by:      ceefour at gauldong dot net
 Summary:          Exception in unknown on line 0 when throwing exception
                   inside exception handler
 Status:           No Feedback
 Type:             Bug
 Package:          Scripting Engine problem
 Operating System: *
 PHP Version:      5CVS-2005-02-15

 New Comment:

This problem is still present as of PHP 5.3.2 on Ubuntu 10.04 using the


following test cases:



<?php

// Example 1

function exceptionHandlerFunc()

{

        throw new Exception("This message should be visible!");

}



set_exception_handler("exceptionHandlerFunc");



throw new Exception("Something bad happened");

?>

<?php

// Example 2

function shutdownFunc()

{

        throw new Exception("This message should be visible!");

}



register_shutdown_function('shutdownFunc');

?>

<?php

// Example 3

class MyClass

{

        public function __destruct()

        {

                throw new Exception("This message should be visible!");

        }

}



$test = new MyClass();

?>



All result in this error: 'Fatal error: Exception thrown without a stack
frame 

in Unknown on line 0'



While I can understand their may be complexities with stack traces, and
even 

file and line numbers in these contexts, the original error message
should at 

least be visible so that it can be debugged and resolved, i.e. Fatal
error: 

Exception (type: Exception, message: 'This message should be visible!')
thrown 

without a stack frame in Unknown on line 0.


Previous Comments:
------------------------------------------------------------------------
[2010-03-25 21:32:30] [email protected]

Maybe related to Bug #51394

------------------------------------------------------------------------
[2007-10-30 01:00:01] 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".

------------------------------------------------------------------------
[2007-10-22 08:48:40] [email protected]

Does this still happen using latest CVS snapshot/checkout of PHP 5.2
branch?

------------------------------------------------------------------------
[2007-10-22 08:47:25] [email protected]

See also bug #43016



------------------------------------------------------------------------
[2007-10-18 11:26:41] ceefour at gauldong dot net

You know, "complicated" stack traces like the one you get in Java would
be much more helpful than this message. Or the one in Erlang. Or in Ruby
with Rails.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=32101


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=32101&edit=1

Reply via email to