From: Vsevolod Stakhov Date: Mon, 4 May 2015 21:03:41 +0000 (+0100) Subject: Be more clever about printing errors. X-Git-Tag: 0.9.0~100 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7ab692f4b779f12030a22af9a139e18b441e6ff6;p=rspamd.git Be more clever about printing errors. --- diff --git a/src/http_proxy.c b/src/http_proxy.c index 3309d5d71..8138c694f 100644 --- a/src/http_proxy.c +++ b/src/http_proxy.c @@ -182,7 +182,7 @@ init_http_proxy (struct rspamd_config *cfg) struct http_proxy_ctx *ctx; GQuark type; - type = g_quark_try_string ("http-proxy"); + type = g_quark_try_string ("http_proxy"); ctx = g_malloc0 (sizeof (struct http_proxy_ctx)); ctx->timeout = 5.0; diff --git a/src/libserver/cfg_rcl.c b/src/libserver/cfg_rcl.c index 6fc3eb260..ab3d21702 100644 --- a/src/libserver/cfg_rcl.c +++ b/src/libserver/cfg_rcl.c @@ -2276,7 +2276,8 @@ rspamd_config_read (struct rspamd_config *cfg, const gchar *filename, } if (!rspamd_rcl_parse (top, cfg, cfg->cfg_pool, cfg->rcl_obj, &err)) { - msg_err ("rcl parse error: %s", err->message); + msg_err ("rcl parse error: %e", err); + g_error_free (err); return FALSE; } diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 70ca74442..7aeb8bcdc 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -189,8 +189,8 @@ redirector_insert (gpointer st, gconstpointer key, gpointer value) "ir", &err); if (re == NULL) { - msg_warn ("could not read regexp: %s while reading regexp %s", - err->message, + msg_warn ("could not read regexp: %e while reading regexp %s", + err, p); g_error_free (err); re = NO_REGEXP; @@ -845,8 +845,8 @@ make_surbl_requests (struct rspamd_url *url, struct rspamd_task *task, } else if (err != NULL && err->code != WHITELIST_ERROR && err->code != DUPLICATE_ERROR) { - msg_info ("cannot format url string for surbl %s, %s", struri ( - url), err->message); + msg_info ("cannot format url string for surbl %s, %e", struri ( + url), err); g_error_free (err); return; } @@ -933,9 +933,9 @@ surbl_redirector_error (struct rspamd_http_connection *conn, { struct redirector_param *param = (struct redirector_param *)conn->ud; - msg_err ("connection with http server %s terminated incorrectly: %s", + msg_err ("connection with http server %s terminated incorrectly: %e", rspamd_inet_address_to_string (rspamd_upstream_addr (param->redirector)), - err->message); + err); rspamd_upstream_fail (param->redirector); remove_normal_event (param->task->s, free_redirector_session, param); diff --git a/src/worker.c b/src/worker.c index ddd01f9da..7c72b0515 100644 --- a/src/worker.c +++ b/src/worker.c @@ -145,8 +145,8 @@ rspamd_worker_error_handler (struct rspamd_http_connection *conn, GError *err) { struct rspamd_task *task = (struct rspamd_task *) conn->ud; - msg_info ("abnormally closing connection from: %s, error: %s", - rspamd_inet_address_to_string (task->client_addr), err->message); + msg_info ("abnormally closing connection from: %s, error: %e", + rspamd_inet_address_to_string (task->client_addr), err); /* Terminate session immediately */ destroy_session (task->s); } @@ -354,7 +354,8 @@ start_worker (struct rspamd_worker *worker) TRUE, &err); if (err != NULL) { - msg_err ("pool create failed: %s", err->message); + msg_err ("pool create failed: %e", err); + g_error_free (err); ctx->classify_pool = NULL; } }