From c570795ac760a7b3f6c10d3e7f4f3c7ca3018510 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 10 Mar 2009 17:53:05 -0400 Subject: [PATCH] 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 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c index 356d5bcfa..200ae7bde 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); } }