[seed] interpreter: display exceptions (if any) when trying to execute the repl



commit 0f9ce34375f9bfda6b11e6ccbb54b4fd75f2eb40
Author: Tim Horton <hortont424 gmail com>
Date:   Wed Dec 30 03:40:25 2009 -0500

    interpreter: display exceptions (if any) when trying to execute the repl

 src/main.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index f2a8e6a..fb60790 100644
--- a/src/main.c
+++ b/src/main.c
@@ -36,10 +36,21 @@ static void
 seed_repl ()
 {
   SeedScript *script;
+  SeedException e;
 
   script = seed_make_script (eng->context, "repl = imports.repl", NULL, 0);
+
+  if ((e = seed_script_exception (script)))
+    {
+      g_critical ("%s", seed_exception_to_string (eng->context, e));
+      exit (EXIT_FAILURE);
+    }
+
   seed_evaluate (eng->context, script, 0);
 
+  if ((e = seed_script_exception (script)))
+    g_critical ("%s", seed_exception_to_string (eng->context, e));
+
   g_free (script);
 }
 



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