diff options
author | Rob Richards <rrichards@php.net> | 2005-02-20 22:01:24 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2005-02-20 22:01:24 +0000 |
commit | 8913ddc295e8ca91a84d7a3959ada6893dac35ea (patch) | |
tree | 566669c464d14a99cbd44bfffcb3405fea1ea87f /ext/dom/domexception.c | |
parent | b7cf6f4539fa315b5758cac319472bda11c79094 (diff) | |
download | php-git-8913ddc295e8ca91a84d7a3959ada6893dac35ea.tar.gz |
use new error handling when not throwing exceptions
Diffstat (limited to 'ext/dom/domexception.c')
-rw-r--r-- | ext/dom/domexception.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c index 538bc682b6..e5092a21fc 100644 --- a/ext/dom/domexception.c +++ b/ext/dom/domexception.c @@ -41,6 +41,16 @@ zend_function_entry php_dom_domexception_class_functions[] = { {NULL, NULL, NULL} }; +/* {{{ php_dom_throw_error_with_message */ +void php_dom_throw_error_with_message(int error_code, char *error_message, int strict_error TSRMLS_DC) +{ + if (strict_error == 1) { + zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC); + } else { + php_libxml_issue_error(E_WARNING, error_message TSRMLS_CC); + } +} + /* {{{ php_dom_throw_error */ void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC) { @@ -100,11 +110,7 @@ void php_dom_throw_error(int error_code, int strict_error TSRMLS_DC) error_message = "Unhandled Error"; } - if (strict_error == 1) { - zend_throw_exception(dom_domexception_class_entry, error_message, error_code TSRMLS_CC); - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error_message); - } + php_dom_throw_error_with_message(error_code, error_message, strict_error TSRMLS_CC); } /* }}} end php_dom_throw_error */ |