Skip to content

Commit

Permalink
Fix bug #47143, bug #51458 - provide more useful info in bad exceptio…
Browse files Browse the repository at this point in the history
…n cases
  • Loading branch information
smalyshev committed Jan 16, 2011
1 parent b4dba12 commit 0c1ba13
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Zend/tests/exception_handler_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions Zend/zend_exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down

0 comments on commit 0c1ba13

Please sign in to comment.