exit () on JavaScript exceptions

This is better than being in a wedged state.  See the comment
for more argument.
This commit is contained in:
Colin Walters 2009-03-10 17:53:05 -04:00
parent 947303cc0b
commit c570795ac7

View File

@ -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);
}
}