mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
init: Improve error message formatting
Instead of manually formatting the error message and stack, use the same
formatting mechanism as we do when displaying errors to the user that
occur while opening extension preferences. This should correctly
indicate where syntax errors from imported modules occur.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
(cherry picked from commit 1692004b6b)
This commit is contained in:
parent
070b170f9c
commit
40618b3ee7
1 changed files with 2 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import GLib from 'gi://GLib';
|
|||
import Gio from 'gi://Gio';
|
||||
|
||||
import './environment.js';
|
||||
import {formatError} from '../misc/errorUtils.js';
|
||||
|
||||
// Run the Mutter main loop after
|
||||
// GJS finishes resolving this module.
|
||||
|
|
@ -10,8 +11,7 @@ imports._promiseNative.setMainLoopHook(() => {
|
|||
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}`);
|
||||
Gio.IOErrorEnum, Gio.IOErrorEnum.FAILED, formatError(e));
|
||||
global.context.terminate_with_error(error);
|
||||
});
|
||||
return GLib.SOURCE_REMOVE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue