summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
authorAaron Piotrowski <aaron@trowski.com>2015-07-03 13:41:17 -0500
committerAaron Piotrowski <aaron@trowski.com>2015-07-03 17:53:40 -0500
commit5a99c07eccb09c3c8b9f6fe4b83020163aad6498 (patch)
tree2405c51d16e14ca24fed2811148220388798b222 /Zend/zend_exceptions.c
parent866bd89b1d909795bd5ae72121089aef5e0fb204 (diff)
downloadphp-git-5a99c07eccb09c3c8b9f6fe4b83020163aad6498.tar.gz
Enable throwing custom exceptions from errors
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 9a1b79184a..0251d17e31 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -261,7 +261,7 @@ ZEND_METHOD(exception, __construct)
} else {
ce = base_ce;
}
- zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for %s([string $message [, long $code [, Throwable $previous = NULL]]])", ZSTR_VAL(ce->name));
+ zend_throw_error(zend_ce_error, E_EXCEPTION, "Wrong parameters for %s([string $message [, long $code [, Throwable $previous = NULL]]])", ZSTR_VAL(ce->name));
return;
}
@@ -297,7 +297,7 @@ ZEND_METHOD(error_exception, __construct)
} else {
ce = zend_ce_error_exception;
}
- zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for %s([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Throwable $previous = NULL]]]]]])", ZSTR_VAL(ce->name));
+ zend_throw_error(zend_ce_error, E_EXCEPTION, "Wrong parameters for %s([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Throwable $previous = NULL]]]]]])", ZSTR_VAL(ce->name));
return;
}
@@ -1033,7 +1033,7 @@ ZEND_API void zend_throw_exception_object(zval *exception) /* {{{ */
exception_ce = Z_OBJCE_P(exception);
if (!exception_ce || !instanceof_function(exception_ce, zend_ce_throwable)) {
- zend_error(E_EXCEPTION | E_ERROR, "Cannot throw objects that do not implement Throwable");
+ zend_throw_error(zend_ce_error, E_EXCEPTION, "Cannot throw objects that do not implement Throwable");
return;
}
zend_throw_exception_internal(exception);