From 6111d64cda04a86e3a428edb36f064a187163825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Fri, 17 Apr 2020 00:09:15 +0200 Subject: Improve a last couple of argument error messages Closes GH-5404 --- win32/signal.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'win32') 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)) { -- cgit v1.2.1