index: improve error message when file does not seem to be an email
This commit is contained in:
@ -139,8 +139,13 @@ 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 (!msg) {
|
if (!msg) {
|
||||||
|
if (!err)
|
||||||
g_warning ("error creating message object: %s",
|
g_warning ("error creating message object: %s",
|
||||||
err ? err->message : "cause unknown");
|
fullpath);
|
||||||
|
else {
|
||||||
|
g_warning ("%s", err->message);
|
||||||
|
g_clear_error (&err);
|
||||||
|
}
|
||||||
/* warn, then simply continue */
|
/* warn, then simply continue */
|
||||||
return MU_OK;
|
return MU_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,8 +155,7 @@ init_mime_msg (MuMsgFile *self, const char* path, GError **err)
|
|||||||
g_object_unref (stream);
|
g_object_unref (stream);
|
||||||
if (!parser) {
|
if (!parser) {
|
||||||
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_GMIME,
|
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_GMIME,
|
||||||
"%s: cannot create mime parser for %s",
|
"cannot create mime parser for %s", path);
|
||||||
__FUNCTION__, path);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,8 +163,7 @@ init_mime_msg (MuMsgFile *self, const char* path, GError **err)
|
|||||||
g_object_unref (parser);
|
g_object_unref (parser);
|
||||||
if (!self->_mime_msg) {
|
if (!self->_mime_msg) {
|
||||||
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_GMIME,
|
g_set_error (err, MU_ERROR_DOMAIN, MU_ERROR_GMIME,
|
||||||
"%s: cannot construct mime message for %s",
|
"message seems invalid, ignoring (%s)", path);
|
||||||
__FUNCTION__, path);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user