cvs: ZendEngine2 / zend.c
| From: | Stanislav Malyshev | Date: | Sun, 30 Mar 2003 13:19:00 +0000 |
| Subject: | cvs: ZendEngine2 / zend.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1081@lists.php.net to get a copy of this message | ||
stas Sun Mar 30 08:19:00 2003 EDT
Modified files:
/ZendEngine2 zend.c
Log:
Try to report class name of the exception
Index: ZendEngine2/zend.c
diff -u ZendEngine2/zend.c:1.219 ZendEngine2/zend.c:1.220
--- ZendEngine2/zend.c:1.219 Sat Mar 29 00:19:27 2003
+++ ZendEngine2/zend.c Sun Mar 30 08:19:00 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend.c,v 1.219 2003/03/29 05:19:27 sterling Exp $ */
+/* $Id: zend.c,v 1.220 2003/03/30 13:19:00 stas Exp $ */
#include "zend.h"
#include "zend_extensions.h"
@@ -990,6 +990,12 @@
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 @@
} 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 @@
} 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 @@
}
#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));