From e6f35c5e883ffb94614dfd9ff9367eabff9e2b19 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Tue, 2 Jan 2024 16:24:13 -0800 Subject: [PATCH] main: Improve error formatting in logError() We override GJS's default logError(). This adds the improved formatting of error stack traces that gjs-console would otherwise do as part of logError(). Part-of: --- js/ui/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/main.js b/js/ui/main.js index 3781c9607..4ba3faa8c 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -45,6 +45,7 @@ import * as XdndHandler from './xdndHandler.js'; import * as KbdA11yDialog from './kbdA11yDialog.js'; import * as LocatePointer from './locatePointer.js'; import * as PointerA11yTimeout from './pointerA11yTimeout.js'; +import {formatError} from '../misc/errorUtils.js'; import * as ParentalControlsManager from '../misc/parentalControlsManager.js'; import * as Util from '../misc/util.js'; @@ -144,7 +145,7 @@ function _sessionUpdated() { export async function start() { globalThis.log = console.log; globalThis.logError = function (err, msg) { - const args = [err]; + const args = [formatError(err)]; try { // toString() can throw if (msg)