From 9048890bf614a9c0313c2d27da044193332f1881 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 26 Oct 2020 21:54:18 -0400 Subject: Remove error type from error message (#958) --- ext/bg/js/settings/anki-controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/bg/js/settings/anki-controller.js b/ext/bg/js/settings/anki-controller.js index f3640e3c..6988e4b8 100644 --- a/ext/bg/js/settings/anki-controller.js +++ b/ext/bg/js/settings/anki-controller.js @@ -287,7 +287,8 @@ class AnkiController { } _showAnkiError(error) { - const errorString = `${error}`; + let errorString = typeof error === 'object' && error !== null ? error.message : null; + if (!errorString) { errorString = `${error}`; } this._ankiErrorMessageContainer.textContent = errorString; const data = error.data; -- cgit v1.2.3