From f5151d05386d9e0b139686bdc8420974019e611e Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sun, 3 Jan 2016 15:47:35 +0000
Subject: [PATCH] fix #3269 only print meaningful error code
v2: comment by andrew: prettify error code
some error messages have no meaningful error code, don't display them
Signed-off-by: Andreas Mohr <and@gmx.li>
---
lib/widget/wtools.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/widget/wtools.c b/lib/widget/wtools.c
index 68f5a81..c4c4c20 100644
a
|
b
|
mc_error_message (GError ** mcerror, int *code) |
440 | 440 | if (mcerror == NULL || *mcerror == NULL) |
441 | 441 | return FALSE; |
442 | 442 | |
443 | | message (D_ERROR, MSG_ERROR, _("%d: %s"), (*mcerror)->code, (*mcerror)->message); |
| 443 | if ((*mcerror)->code == 0) |
| 444 | message (D_ERROR, MSG_ERROR, "%s", (*mcerror)->message); |
| 445 | else |
| 446 | message (D_ERROR, MSG_ERROR, "%s (%d)", (*mcerror)->message, (*mcerror)->code); |
444 | 447 | |
445 | 448 | if (code != NULL) |
446 | 449 | *code = (*mcerror)->code; |