interpreter: display exceptions (if any) when trying to execute the repl
authorTim Horton <hortont424@gmail.com>
Wed, 30 Dec 2009 08:40:25 +0000 (03:40 -0500)
committerTim Horton <hortont424@gmail.com>
Wed, 30 Dec 2009 08:40:25 +0000 (03:40 -0500)
src/main.c

index f2a8e6a..fb60790 100644 (file)
@@ -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);
 }