changeset 5287:8a88f44c2151 HEAD

If anything (syncing) fails because there's not enough disk space, give user a nice error message instead of internal error.
author Timo Sirainen <tss@iki.fi>
date Sun, 11 Mar 2007 20:16:45 +0200
parents bf90ba82e2db
children be68f8b64aee
files src/lib-storage/index/mbox/mbox-storage.c
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-storage.c	Sun Mar 11 20:03:55 2007 +0200
+++ b/src/lib-storage/index/mbox/mbox-storage.c	Sun Mar 11 20:16:45 2007 +0200
@@ -71,8 +71,14 @@
 {
 	i_assert(function != NULL);
 
-	mail_storage_set_critical(STORAGE(mbox->storage),
-		"%s failed with mbox file %s: %m", function, mbox->path);
+	if (ENOSPACE(errno)) {
+		mail_storage_set_error(STORAGE(mbox->storage),
+				       "Not enough disk space");
+	} else {
+		mail_storage_set_critical(STORAGE(mbox->storage),
+					  "%s failed with mbox file %s: %m",
+					  function, mbox->path);
+	}
 	return -1;
 }