[gcalctool/gnome-3-6] Fix error reporting issue



commit 0b919b1309a13591b4d9434671ce86ef0c1d0740
Author: PioneerAxon <arth svnit gmail com>
Date:   Fri Oct 5 02:03:14 2012 +0530

    Fix error reporting issue
    
    Fixed a bug, where reporting didn't work for specific type of inputs.

 src/math-equation.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/math-equation.c b/src/math-equation.c
index a16d031..5bcae64 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:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]