From ca3f03ea5ed46d4a6c4815bedd2469a69f3b1183 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 9 May 2021 15:16:40 +0900 Subject: Improve an error message on invalid settings --- src/background/presenters/Notifier.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/background/presenters') diff --git a/src/background/presenters/Notifier.ts b/src/background/presenters/Notifier.ts index 957572d..d828b2e 100644 --- a/src/background/presenters/Notifier.ts +++ b/src/background/presenters/Notifier.ts @@ -4,7 +4,7 @@ const NOTIFICATION_ID_INVALID_SETTINGS = "vimvixen-update-invalid-settings"; export default interface Notifier { notifyUpdated(version: string, onclick: () => void): Promise; - notifyInvalidSettings(onclick: () => void): Promise; + notifyInvalidSettings(error: Error, onclick: () => void): Promise; } export class NotifierImpl implements NotifierImpl { @@ -29,11 +29,13 @@ export class NotifierImpl implements NotifierImpl { }); } - async notifyInvalidSettings(onclick: () => void): Promise { + async notifyInvalidSettings( + error: Error, + onclick: () => void + ): Promise { const title = `Loading settings failed`; // eslint-disable-next-line max-len - const message = - "The default settings are used due to the last saved settings is invalid. Check your current settings from the add-on preference"; + const message = `The default settings are used due to the last saved settings is invalid. Check your current settings from the add-on preference: ${error.message}`; const listener = (id: string) => { if (id !== NOTIFICATION_ID_INVALID_SETTINGS) { -- cgit v1.2.3