[gnome-shell] exit () on JavaScript exceptions



commit c570795ac760a7b3f6c10d3e7f4f3c7ca3018510
Author: Colin Walters <walters verbum org>
Date:   Tue Mar 10 17:53:05 2009 -0400

    exit () on JavaScript exceptions
    
    This is better than being in a wedged state.  See the comment
    for more argument.
---
 src/gnome-shell-plugin.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c
index 356d5bc..200ae7b 100644
--- a/src/gnome-shell-plugin.c
+++ b/src/gnome-shell-plugin.c
@@ -202,8 +202,20 @@ gnome_shell_plugin_constructed (GObject *object)
                          &status,
                          &error))
     {
-      g_warning ("Evaling main.js failed: %s", error->message);
+      g_message ("Execution of main.js threw exception: %s", error->message);
       g_error_free (error);
+      /* We just exit() here, since in a development environment you'll get the
+       * error in your shell output, and it's way better than a busted WM,
+       * which typically manifests as a white screen.
+       *
+       * In production, we shouldn't crash =)  But if we do, we should get
+       * restarted by the session infrastructure, which is likely going
+       * to be better than some undefined state.
+       *
+       * If there was a generic "hook into bug-buddy for non-C crashes"
+       * infrastructure, here would be the place to put it.
+       */
+      exit (1);
     }
 }
 



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