changeset 3948:1382d265b71d

Error reporting added.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 30 Oct 2007 11:22:07 +0200
parents dd5c459c5f2d
children 57dd6ddaa8af
files src/audacious/tuple_formatter.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/tuple_formatter.c	Sun Oct 28 09:19:29 2007 -0500
+++ b/src/audacious/tuple_formatter.c	Tue Oct 30 11:22:07 2007 +0200
@@ -528,6 +528,7 @@
 #ifdef TUPLE_USE_COMPILER
     static TupleEvalContext *last_ctx = NULL;
     static TupleEvalNode *last_ev = NULL;
+    gchar *result = NULL;
 #endif
 
     if (initialized == FALSE)
@@ -556,6 +557,12 @@
         last_ctx = tuple_evalctx_new();
         last_string = g_strdup(string);
         last_ev = tuple_formatter_compile(last_ctx, last_string);
+        if (last_ctx->iserror) {
+            fprintf(stderr, "[TuplezCC]: %s", last_ctx->errmsg);
+        }
+        if (!last_ev) {
+            fprintf(stderr, "[TuplezCC]: Compilation failed!\n");
+        }
     }
 
 #ifdef TUPLE_COMPILER_DEBUG
@@ -567,7 +574,11 @@
 #endif
 
     tuple_evalctx_reset(last_ctx);
-    return tuple_formatter_eval(last_ctx, last_ev, tuple);
+    result = tuple_formatter_eval(last_ctx, last_ev, tuple);
+    if (last_ctx->iserror) {
+        fprintf(stderr, "[TuplezEV]: %s", last_ctx->errmsg);
+    }
+    return result;
 #else
     return tuple_formatter_process_construct(tuple, string);
 #endif