dovecot-1.0: Give better error messages if storage creation fails.

dovecot at dovecot.org dovecot at dovecot.org
Sun Jul 15 14:38:22 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/b9e2be098d60
changeset: 5347:b9e2be098d60
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jul 15 14:38:18 2007 +0300
description:
Give better error messages if storage creation fails.

diffstat:

1 file changed, 10 insertions(+), 9 deletions(-)
src/imap/namespace.c |   19 ++++++++++---------

diffs (39 lines):

diff -r 0a2c21749171 -r b9e2be098d60 src/imap/namespace.c
--- a/src/imap/namespace.c	Sun Jul 15 10:10:12 2007 +0300
+++ b/src/imap/namespace.c	Sun Jul 15 14:38:18 2007 +0300
@@ -75,8 +75,8 @@ namespace_add_env(pool_t pool, const cha
 	ns->storage = mail_storage_create_with_data(data, user, flags,
 						    lock_method);
 	if (ns->storage == NULL) {
-		i_fatal("Failed to create storage for '%s' with data: %s",
-			ns->prefix, data);
+		i_fatal("Namespace '%s' mail storage creation failed "
+			"with mail location: %s", ns->prefix, data);
 	}
 
 	if (sep != NULL)
@@ -129,16 +129,17 @@ struct namespace *namespace_init(pool_t 
 	ns->storage = mail_storage_create_with_data(mail, user, flags,
 						    lock_method);
 	if (ns->storage == NULL) {
-		if (mail != NULL && *mail != '\0')
-			i_fatal("Failed to create storage with data: %s", mail);
-		else {
+		if (mail != NULL && *mail != '\0') {
+			i_fatal("Mail storage creation failed with "
+				"mail_location: %s", mail);
+		} else {
 			const char *home;
 
 			home = getenv("HOME");
-			if (home == NULL) home = "not set";
-
-			i_fatal("MAIL environment missing and "
-				"autodetection failed (home %s)", home);
+			if (home == NULL || *home == '\0') home = "(not set)";
+
+			i_fatal("mail_location not set and "
+				"autodetection failed with home=%s", home);
 		}
 	}
 


More information about the dovecot-cvs mailing list