]> granicus.if.org Git - php/commitdiff
Fix bug #47143, bug #51458 - provide more useful info in bad exception cases
authorStanislav Malyshev <stas@php.net>
Sun, 16 Jan 2011 21:24:43 +0000 (21:24 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 16 Jan 2011 21:24:43 +0000 (21:24 +0000)
Zend/tests/exception_handler_002.phpt
Zend/zend_exceptions.c

index 3e0e4f00dd908111822ea47232e63db482b0cb9c..7dfbb38fd189a49a82a781569cc0e4284c42cc06 100644 (file)
@@ -20,4 +20,8 @@ echo "Done\n";
 --EXPECTF--    
 string(12) "test thrown!"
 
-Fatal error: Exception thrown without a stack frame in Unknown on line 0
+Fatal error: Uncaught exception 'Exception' in %sexception_handler_002.php:7
+Stack trace:
+#0 [internal function]: foo(Object(test))
+#1 {main}
+  thrown in %sexception_handler_002.php on line %d
index 28d20630317a1fe24a0b23e8d420d484190a395c..0865815c95cc057b2fc7a372918b59c89004e4e7 100644 (file)
@@ -106,6 +106,9 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC) /* {{{ */
                }
        }
        if (!EG(current_execute_data)) {
+               if(EG(exception)) {
+                       zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
+               }
                zend_error(E_ERROR, "Exception thrown without a stack frame");
        }