changeset 20476:35fce9a2bdfd

doveadm mailbox update: Avoid assert-crash on errors.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Fri, 01 Jul 2016 11:07:47 +0300
parents 591863def76d
children 1173fef0844a
files src/doveadm/doveadm-mail-mailbox.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/doveadm-mail-mailbox.c	Fri Jul 01 02:49:32 2016 +0300
+++ b/src/doveadm/doveadm-mail-mailbox.c	Fri Jul 01 11:07:47 2016 +0300
@@ -639,6 +639,7 @@
 	struct update_cmd_context *ctx = (struct update_cmd_context *)_ctx;
 	struct mail_namespace *ns;
 	struct mailbox *box;
+	enum mail_error mail_error;
 	int ret = 0;
 
 	ns = mail_namespace_find(user->namespaces, ctx->mailbox);
@@ -647,7 +648,8 @@
 	if ((ret = mailbox_update(box, &(ctx->update))) != 0) {
 		i_error("Cannot update %s: %s",
 			ctx->mailbox,
-			mailbox_get_last_error(box, NULL));
+			mailbox_get_last_error(box, &mail_error));
+		doveadm_mail_failed_error(_ctx, mail_error);
 	}
 
 	mailbox_free(&box);