Commit 31f9e897 31f9e897d6c4a2faa83e96c437493554c12e48d3 by Sergey Poznyakoff

Produce more detailed diagnostics

1 parent 6dbe7cac
......@@ -88,7 +88,8 @@ main (int argc, char **argv)
if ((ret = mailbox_create_default (&mbox, mailbox_name)) != 0)
{
fprintf (stderr, "could not create - %s\n", mu_strerror (ret));
fprintf (stderr, "could not create %s: %s\n",
mailbox_name, mu_strerror (ret));
exit (2);
}
......
......@@ -63,10 +63,18 @@ mail_copy0 (int argc, char **argv, int mark)
return 1;
}
if (mailbox_create_default (&mbx, filename)
|| mailbox_open (mbx, MU_STREAM_WRITE | MU_STREAM_CREAT))
if ((status = mailbox_create_default (&mbx, filename)) != 0)
{
util_error (_("Cannot create mailbox %s"), filename);
util_error (_("Cannot create mailbox %s: %s"), filename,
mu_strerror (status));
free (filename);
msgset_free (msglist);
return 1;
}
if ((status = mailbox_open (mbx, MU_STREAM_WRITE | MU_STREAM_CREAT)) != 0)
{
util_error (_("Cannot open mailbox %s: %s"), filename,
mu_strerror (status));
free (filename);
msgset_free (msglist);
return 1;
......
......@@ -105,12 +105,18 @@ mail_mbox_commit ()
if (!dest_mbox)
{
char *name = getenv ("MBOX");
if (mailbox_create_default (&dest_mbox, name)
|| mailbox_open (dest_mbox,
MU_STREAM_WRITE | MU_STREAM_CREAT))
if ((status = mailbox_create_default (&dest_mbox, name)) != 0)
{
util_error (_("Cannot create mailbox %s: %s"), name,
mu_strerror (status));
return 1;
}
if ((status = mailbox_open (dest_mbox,
MU_STREAM_WRITE | MU_STREAM_CREAT))!=0)
{
util_error (_("Cannot create mailbox %s"), name);
util_error (_("Cannot open mailbox %s: %s"), name,
mu_strerror (status));
return 1;
}
}
......
......@@ -539,7 +539,8 @@ mail_send0 (compose_env_t * env, int save_to)
mailbox_destroy (&mbx);
}
if (status)
util_error (_("Cannot create mailbox %s"), env->outfiles[i]);
util_error (_("Cannot create mailbox %s: %s"),
env->outfiles[i], mu_strerror (status));
}
}
}
......