49464e3c7a
If a failure happened during initialization the shell does not provide any debug information, and so only the error is shown without a stack trace. Since this information is provided, pass it as the error message. Do not log this directly from JS so that we just use one termination path. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2899>
23 lines
692 B
JavaScript
23 lines
692 B
JavaScript
import GLib from 'gi://GLib';
|
|
import Gio from 'gi://Gio';
|
|
|
|
import './environment.js';
|
|
|
|
// Run the Mutter main loop after
|
|
// GJS finishes resolving this module.
|
|
imports._promiseNative.setMainLoopHook(() => {
|
|
// Queue starting the shell
|
|
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
|
|
import('./main.js').then(main => main.start()).catch(e => {
|
|
const error = new GLib.Error(
|
|
Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED,
|
|
`${e.message}\n${e.stack}`);
|
|
global.context.terminate_with_error(error);
|
|
});
|
|
return GLib.SOURCE_REMOVE;
|
|
});
|
|
|
|
// Run the meta context's main loop
|
|
global.context.run_main_loop();
|
|
});
|