diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-10-13 09:33:36 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-10-13 21:52:15 +0200 |
commit | 13a057f0b20c0e69c613e75b5750cb4a9aacf520 (patch) | |
tree | a154124e8e1c6194fbfaf2ce189990e61482ac09 /src | |
parent | 3735397a0ff5347308f3dae9d56ec1a0e61133e6 (diff) | |
download | weechat-13a057f0b20c0e69c613e75b5750cb4a9aacf520.zip |
core: only print hook_url errors when debug is enabled
Errors from hook_url should be handled by the caller, so don't print
them to the core buffer by default. Only print them when
weechat_debug_core is enabled. This was already the behavior for the
timeout error.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hook/wee-hook-url.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/hook/wee-hook-url.c b/src/core/hook/wee-hook-url.c index f34d767a2..07149461a 100644 --- a/src/core/hook/wee-hook-url.c +++ b/src/core/hook/wee-hook-url.c @@ -172,7 +172,7 @@ hook_url_timer_cb (const void *pointer, void *data, int remaining_calls) { hook_url_run_callback (hook); ptr_error = hashtable_get (HOOK_URL(hook, output), "error"); - if (ptr_error && ptr_error[0]) + if ((weechat_debug_core >= 1) && ptr_error && ptr_error[0]) { gui_chat_printf ( NULL, @@ -242,11 +242,14 @@ hook_url_transfer (struct t_hook *hook) str_error_code_pthread); hook_url_run_callback (hook); - gui_chat_printf (NULL, - _("%sError running thread in hook_url: %s (URL: \"%s\")"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - strerror (rc), - HOOK_URL(hook, url)); + if (weechat_debug_core >= 1) + { + gui_chat_printf (NULL, + _("%sError running thread in hook_url: %s (URL: \"%s\")"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + strerror (rc), + HOOK_URL(hook, url)); + } unhook (hook); return; } |