Mercurial > dovecot > core-2.2
comparison src/lib-storage/index/index-storage.c @ 13:bb294faf7379 HEAD
"Critical errors" aren't displayed to users anymore, ie. anything that is
not a predefined human readable error message is written into log file and
user gets only "Internal error [timestamp]".
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 22 Aug 2002 17:50:16 +0300 |
parents | 82b7de533f98 |
children | 306c20092a96 |
comparison
equal
deleted
inserted
replaced
12:a4423c83b2b0 | 13:bb294faf7379 |
---|---|
8 MailIndex *index, const char *name, | 8 MailIndex *index, const char *name, |
9 int readonly) | 9 int readonly) |
10 { | 10 { |
11 IndexMailbox *ibox; | 11 IndexMailbox *ibox; |
12 FlagsFile *flagsfile; | 12 FlagsFile *flagsfile; |
13 const char *path, *error; | 13 const char *path; |
14 | 14 |
15 i_assert(name != NULL); | 15 i_assert(name != NULL); |
16 | 16 |
17 /* open the index first */ | 17 /* open the index first */ |
18 if (!index->open_or_create(index, !readonly)) { | 18 if (!index->open_or_create(index, !readonly)) { |
19 error = index->get_last_error(index); | 19 mail_storage_set_internal_error(storage); |
20 if (error == NULL) | |
21 error = "(maildir_open)"; | |
22 mail_storage_set_error(storage, "%s", error); | |
23 | |
24 index->free(index); | 20 index->free(index); |
25 return NULL; | 21 return NULL; |
26 } | 22 } |
27 | 23 |
28 /* then flags file */ | 24 /* then flags file */ |
58 i_free(box); | 54 i_free(box); |
59 } | 55 } |
60 | 56 |
61 int mail_storage_set_index_error(IndexMailbox *ibox) | 57 int mail_storage_set_index_error(IndexMailbox *ibox) |
62 { | 58 { |
63 const char *error; | |
64 | |
65 error = ibox->index->get_last_error(ibox->index); | |
66 if (error == NULL) | |
67 error = "(no error message)"; | |
68 | |
69 ibox->box.inconsistent = | 59 ibox->box.inconsistent = |
70 ibox->index->is_inconsistency_error(ibox->index); | 60 ibox->index->is_inconsistency_error(ibox->index); |
71 mail_storage_set_error(ibox->box.storage, "%s", error); | 61 mail_storage_set_internal_error(ibox->box.storage); |
72 return FALSE; | 62 return FALSE; |
73 } | 63 } |
74 | 64 |
75 static MailFlags get_used_flags(void *context) | 65 static MailFlags get_used_flags(void *context) |
76 { | 66 { |