add_assoc_double(param, "ultotal", ultotal);
add_assoc_double(param, "ulnow", ulnow);
- call_user_function(EG(function_table), NULL, request->_progress_callback, &retval, 1, ¶m TSRMLS_CC);
+ with_error_handling(EH_NORMAL, NULL) {
+ call_user_function(EG(function_table), NULL, request->_progress_callback, &retval, 1, ¶m TSRMLS_CC);
+ } end_error_handling();
zval_ptr_dtor(¶m);
zval_dtor(&retval);
MAKE_STD_ZVAL(param);
ZVAL_BOOL(param, ret == SUCCESS);
- zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "onfinish", NULL, param);
+ with_error_handling(EH_NORMAL, NULL) {
+ zend_call_method_with_1_params(&getThis(), Z_OBJCE_P(getThis()), NULL, "onfinish", NULL, param);
+ } end_error_handling();
zval_ptr_dtor(¶m);
}
#endif /* ZEND_ENGINE_2 */
/* }}} */
+#ifdef ZEND_ENGINE_2
+# define with_error_handling(eh, ec) \
+ { \
+ error_handling_t __eh = PG(error_handling); \
+ zend_class_entry *__ec= PG(exception_class); \
+ php_set_error_handling(eh, ec TSRMLS_CC);
+# define end_error_handling() \
+ php_set_error_handling(__eh, __ec TSRMLS_CC); \
+ }
+#else
+# define with_error_handling(eh, ec)
+# define end_error_handling()
+#endif
+
#ifndef E_THROW
# define E_THROW 0
#endif