From 0b919b1309a13591b4d9434671ce86ef0c1d0740 Mon Sep 17 00:00:00 2001 From: PioneerAxon Date: Fri, 5 Oct 2012 02:03:14 +0530 Subject: [PATCH] Fix error reporting issue Fixed a bug, where reporting didn't work for specific type of inputs. --- src/math-equation.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/math-equation.c b/src/math-equation.c index a16d0310..5bcae64e 100644 --- a/src/math-equation.c +++ b/src/math-equation.c @@ -1242,7 +1242,14 @@ math_equation_solve_real(gpointer data) break; case PARSER_ERR_MP: - solvedata->error = g_strdup(mp_get_error()); + if (mp_get_error()) + solvedata->error = g_strdup(mp_get_error()); + else if (error_token) + solvedata->error = g_strdup_printf(/* Uncategorized error. Show error token to user*/ + _("Malformed expression at token '%s'"), error_token); + else + solvedata->error = g_strdup (/* Unknown error. */ + _("Malformed expression")); break; default: -- 2.11.4.GIT