* mu-index.c: improve error message for invalid e-mails

This commit is contained in:
djcb
2012-05-14 11:20:10 +03:00
parent d6053ec737
commit 77464acc10

View File

@ -130,6 +130,7 @@ insert_or_update_maybe (const char* fullpath, const char* mdir,
{ {
MuMsg *msg; MuMsg *msg;
GError *err; GError *err;
gboolean rv;
*updated = FALSE; *updated = FALSE;
if (!needs_index (data, fullpath, filestamp)) if (!needs_index (data, fullpath, filestamp))
@ -137,26 +138,26 @@ insert_or_update_maybe (const char* fullpath, const char* mdir,
err = NULL; err = NULL;
msg = mu_msg_new_from_file (fullpath, mdir, &err); msg = mu_msg_new_from_file (fullpath, mdir, &err);
if ((G_UNLIKELY(!msg))) if (!msg) {
goto errexit; g_warning ("error creating message object: %s",
err ? err->message : "cause unknown");
/* warn, then simply continue */
return MU_OK;
}
/* we got a valid id; scan the message contents as well */ /* we got a valid id; scan the message contents as well */
if (G_UNLIKELY((!mu_store_add_msg (data->_store, msg, &err)))) rv = mu_store_add_msg (data->_store, msg, &err);
goto errexit;
mu_msg_unref (msg); mu_msg_unref (msg);
*updated = TRUE;
return MU_OK;
errexit: if (!rv) {
{ g_warning ("error storing message object: %s",
MuError me; err ? err->message : "cause unknown");
me = err ? err->code : MU_ERROR;
g_clear_error (&err); g_clear_error (&err);
if (msg) return MU_ERROR;
mu_msg_unref (msg);
return me;
} }
*updated = TRUE;
return MU_OK;
} }