init: Include the error stack in the context termination error message

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>
This commit is contained in:
Marco Trevisan (Treviño) 2023-08-17 23:42:02 +02:00 committed by Marge Bot
parent 8d1aa7bed8
commit 49464e3c7a

View File

@ -11,7 +11,7 @@ imports._promiseNative.setMainLoopHook(() => {
import('./main.js').then(main => main.start()).catch(e => {
const error = new GLib.Error(
Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED,
e.message);
`${e.message}\n${e.stack}`);
global.context.terminate_with_error(error);
});
return GLib.SOURCE_REMOVE;