Ticket #3269: only print meaningful error code.

Some error messages have no meaningful error code, don't display them.

Signed-off-by: Andreas Mohr <and@gmx.li>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andreas Mohr 2016-01-03 15:47:35 +00:00 committed by Andrew Borodin
parent 88b01bde42
commit 842a723f9b

View File

@ -440,7 +440,10 @@ mc_error_message (GError ** mcerror, int *code)
if (mcerror == NULL || *mcerror == NULL)
return FALSE;
message (D_ERROR, MSG_ERROR, _("%d: %s"), (*mcerror)->code, (*mcerror)->message);
if ((*mcerror)->code == 0)
message (D_ERROR, MSG_ERROR, "%s", (*mcerror)->message);
else
message (D_ERROR, MSG_ERROR, "%s (%d)", (*mcerror)->message, (*mcerror)->code);
if (code != NULL)
*code = (*mcerror)->code;