[gnome-shell] extensionSystem: Don't log error name
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] extensionSystem: Don't log error name
- Date: Thu, 21 May 2020 21:50:24 +0000 (UTC)
commit 48e6a58250fd0f59acbed48ee5c222b459c875d8
Author: Florian Müllner <fmuellner gnome org>
Date: Tue May 12 01:12:50 2020 +0200
extensionSystem: Don't log error name
logExtensionError() currently saves the error message by calling
toString() on the passed error. That's convenient as it allows to
pass a string instead of a "proper" error, but the result isn't
great for the common Error case: Its toString() method prefixes
the message with the error name, which usually is just "Error:".
The plain message is more suitable for displaying it to users,
so use that for Error objects.
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2337
js/ui/extensionSystem.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 50244d95fc..f0b8361714 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -260,7 +260,8 @@ var ExtensionManager = class {
if (!extension)
return;
- let message = error.toString();
+ const message = error instanceof Error
+ ? error.message : error.toString();
extension.error = message;
extension.state = ExtensionState.ERROR;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]