extensionSystem: Improve error formatting

This exposes the formatted error with stack trace and proper location of
SyntaxErrors over the bus, instead of just the message.

<https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>
This commit is contained in:
Philip Chimento
2024-01-02 16:29:08 -08:00
committed by Florian Müllner
parent 1692004b6b
commit 71befc5ff7
2 changed files with 11 additions and 7 deletions

View File

@ -9,6 +9,7 @@ import * as Signals from '../misc/signals.js';
import * as Config from '../misc/config.js';
import * as ExtensionDownloader from './extensionDownloader.js';
import {formatError} from '../misc/errorUtils.js';
import {ExtensionState, ExtensionType} from '../misc/extensionUtils.js';
import * as FileUtils from '../misc/fileUtils.js';
import * as Main from './main.js';
@ -359,8 +360,7 @@ export class ExtensionManager extends Signals.EventEmitter {
if (!extension)
return;
const message = error instanceof Error
? error.message : error.toString();
const message = formatError(error, {showStack: false});
console.debug(`Changing state of extension ${uuid} to ERROR`);
extension.error = message;