summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2003-03-30 13:19:00 +0000
committerStanislav Malyshev <stas@php.net>2003-03-30 13:19:00 +0000
commitf008808c8257b68d9b4f9fdca4a694fe1d521002 (patch)
tree53bb78d558f8154a17237010674ae0fcdb232a62
parent0ee6377b425fc7e566bce99bded8154025b3a688 (diff)
downloadphp-git-f008808c8257b68d9b4f9fdca4a694fe1d521002.tar.gz
Try to report class name of the exception
-rw-r--r--Zend/zend.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index fcd0de39fd..84d72cd8d4 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -990,6 +990,12 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
EG(return_value_ptr_ptr) = retval ? retval : &local_retval;
zend_execute(EG(active_op_array) TSRMLS_CC);
if (EG(exception)) {
+ char ex_class_name[128];
+ if(Z_TYPE_P(EG(exception)) == IS_OBJECT) {
+ snprintf(ex_class_name, 127, "%s", Z_OBJ_CLASS_NAME_P(EG(exception)));
+ } else {
+ strcpy(ex_class_name, "Unknown Exception");
+ }
#if 1 /* support set_exception_handler() */
if (EG(user_exception_handler)) {
zval *orig_user_exception_handler;
@@ -1004,7 +1010,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
} else {
zval_ptr_dtor(&EG(exception));
EG(exception) = NULL;
- zend_error(E_ERROR, "Uncaught exception!");
+ zend_error(E_ERROR, "Uncaught exception '%s'!", ex_class_name);
}
efree(params);
zval_ptr_dtor(&EG(exception));
@@ -1012,7 +1018,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
} else {
zval_ptr_dtor(&EG(exception));
EG(exception) = NULL;
- zend_error(E_ERROR, "Uncaught exception!");
+ zend_error(E_ERROR, "Uncaught exception '%s'!", ex_class_name);
}
if (retval == NULL && *EG(return_value_ptr_ptr) != NULL) {
zval_ptr_dtor(EG(return_value_ptr_ptr));
@@ -1020,7 +1026,7 @@ ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_co
}
#else
zval_ptr_dtor(&EG(exception));
- zend_error(E_ERROR, "Uncaught exception!");
+ zend_error(E_ERROR, "Uncaught exception '%s'!", ex_class_name);
#endif
} else if (!retval) {
zval_ptr_dtor(EG(return_value_ptr_ptr));