summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-04-17 00:09:15 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-04-20 13:09:00 +0200
commit6111d64cda04a86e3a428edb36f064a187163825 (patch)
tree2842f8f5d7ecbd1e4033ca0bafd483db270528e5 /win32
parent283d37ad8f0e439cc6a454811946d9f7ccd25eb7 (diff)
downloadphp-git-6111d64cda04a86e3a428edb36f064a187163825.tar.gz
Improve a last couple of argument error messages
Closes GH-5404
Diffstat (limited to 'win32')
-rw-r--r--win32/signal.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/win32/signal.c b/win32/signal.c
index 27ebf835c9..26bedd1088 100644
--- a/win32/signal.c
+++ b/win32/signal.c
@@ -98,13 +98,13 @@ PHP_FUNCTION(sapi_windows_set_ctrl_handler)
#if ZTS
if (!tsrm_is_main_thread()) {
zend_throw_error(NULL, "CTRL events can only be received on the main thread");
- return;
+ RETURN_THROWS();
}
#endif
if (!php_win32_console_is_cli_sapi()) {
zend_throw_error(NULL, "CTRL events trapping is only supported on console");
- return;
+ RETURN_THROWS();
}
@@ -118,10 +118,8 @@ PHP_FUNCTION(sapi_windows_set_ctrl_handler)
}
if (!zend_is_callable(handler, 0, NULL)) {
- zend_string *func_name = zend_get_callable_name(handler);
- zend_type_error("%s is not a callable function name error", ZSTR_VAL(func_name));
- zend_string_release_ex(func_name, 0);
- return;
+ zend_argument_type_error(1, "must be a valid callable function name");
+ RETURN_THROWS();
}
if (!SetConsoleCtrlHandler(NULL, FALSE) || !SetConsoleCtrlHandler(php_win32_signal_system_ctrl_handler, add)) {