From: Timo Sirainen Date: Fri, 4 Aug 2017 15:20:50 +0000 (+0300) Subject: lazy-expunge: Log internal errors instead of just "Internal error occurred" X-Git-Tag: 2.3.0.rc1~1197 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a2511b99dd8bfc5ffec75ccb22f761b2b831cfd;p=thirdparty%2Fdovecot%2Fcore.git lazy-expunge: Log internal errors instead of just "Internal error occurred" --- diff --git a/src/plugins/lazy-expunge/lazy-expunge-plugin.c b/src/plugins/lazy-expunge/lazy-expunge-plugin.c index 20ddceffb5..ce7c02ed86 100644 --- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c @@ -59,6 +59,7 @@ struct lazy_expunge_transaction { HASH_TABLE(const char *, void *) guids; char *delayed_errstr; + char *delayed_internal_errstr; enum mail_error delayed_error; bool copy_only_last_instance; @@ -271,6 +272,8 @@ static void lazy_expunge_set_error(struct lazy_expunge_transaction *lt, return; lt->delayed_error = error; lt->delayed_errstr = i_strdup(errstr); + lt->delayed_internal_errstr = + i_strdup(mail_storage_get_last_internal_error(storage, NULL)); } static void lazy_expunge_mail_expunge(struct mail *_mail) @@ -398,6 +401,7 @@ static void lazy_expunge_transaction_free(struct lazy_expunge_transaction *lt) if (lt->pool != NULL) pool_unref(<->pool); i_free(lt->delayed_errstr); + i_free(lt->delayed_internal_errstr); i_free(lt); } @@ -424,7 +428,8 @@ lazy_expunge_transaction_commit(struct mailbox_transaction_context *ctx, ret = -1; } else { mail_storage_set_critical(ctx->box->storage, - "Lazy-expunge transaction failed: %s", lt->delayed_errstr); + "Lazy-expunge transaction failed: %s", + lt->delayed_internal_errstr); mbox->super.transaction_rollback(ctx); ret = -1; }