1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

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.
This commit is contained in:
Trygve Aaberge
2023-10-13 09:33:36 +02:00
committed by Sébastien Helleu
parent 3735397a0f
commit 13a057f0b2
+9 -6
View File
@@ -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;
}