diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2015-06-14 22:43:11 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2015-06-14 22:43:11 -0500 |
commit | 4d590ac35a3a68b8b453cd9bbf3f1300c2507d87 (patch) | |
tree | c64f9f02082f5ebf9917cc96cb76212ab24d0024 /Zend/zend_exceptions.c | |
parent | 110e0a5a2cda3bfa7778bb871502ff2b50e59f76 (diff) | |
download | php-git-4d590ac35a3a68b8b453cd9bbf3f1300c2507d87.tar.gz |
Update exception error messages
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r-- | Zend/zend_exceptions.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index ae55c1fcea..2a3152a00b 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -53,7 +53,7 @@ void zend_exception_set_previous(zend_object *exception, zend_object *add_previo } ZVAL_OBJ(&tmp, add_previous); if (!instanceof_function(Z_OBJCE(tmp), zend_ce_throwable)) { - zend_error_noreturn(E_CORE_ERROR, "Cannot set non exception as previous exception"); + zend_error_noreturn(E_CORE_ERROR, "Previous exception must implement Throwable"); return; } ZVAL_OBJ(&zv, exception); @@ -215,7 +215,7 @@ ZEND_METHOD(exception, __clone) } /* }}} */ -/* {{{ proto Exception::__construct(string message, int code [, Exception previous]) +/* {{{ proto Exception::__construct(string message, int code [, Throwable previous]) Exception constructor */ ZEND_METHOD(exception, __construct) { @@ -229,7 +229,7 @@ ZEND_METHOD(exception, __construct) base_ce = zend_get_exception_base(object); if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|SlO!", &message, &code, &previous, base_ce) == FAILURE) { - zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]])"); + zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for %s([string $message [, long $code [, Throwable $previous = NULL]]])", base_ce->name->val); return; } @@ -247,7 +247,7 @@ ZEND_METHOD(exception, __construct) } /* }}} */ -/* {{{ proto ErrorException::__construct(string message, int code, int severity [, string filename [, int lineno [, Exception previous]]]) +/* {{{ proto ErrorException::__construct(string message, int code, int severity [, string filename [, int lineno [, Throwable previous]]]) ErrorException constructor */ ZEND_METHOD(error_exception, __construct) { @@ -258,7 +258,7 @@ ZEND_METHOD(error_exception, __construct) size_t message_len, filename_len; if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|sllslO!", &message, &message_len, &code, &severity, &filename, &filename_len, &lineno, &previous, default_exception_ce) == FAILURE) { - zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for ErrorException([string $exception [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Exception $previous = NULL]]]]]])"); + zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for ErrorException([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno [, Throwable $previous = NULL]]]]]])"); return; } @@ -761,14 +761,14 @@ void zend_register_default_exception(void) /* {{{ */ zend_class_entry ce; zend_property_info *prop; + memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + default_exception_handlers.clone_obj = NULL; + INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions); default_exception_ce = zend_register_internal_class_ex(&ce, NULL); default_exception_ce->create_object = zend_default_exception_new; zend_class_implements(default_exception_ce, 1, zend_ce_throwable); - memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - default_exception_handlers.clone_obj = NULL; - zend_declare_property_string(default_exception_ce, "message", sizeof("message")-1, "", ZEND_ACC_PROTECTED); zend_declare_property_string(default_exception_ce, "string", sizeof("string")-1, "", ZEND_ACC_PRIVATE); zend_declare_property_long(default_exception_ce, "code", sizeof("code")-1, 0, ZEND_ACC_PROTECTED); |