From e0bff54a827bcf15931ed651d4a5279b352a2961 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 3 Sep 2017 16:13:02 +0900 Subject: use promise and show errors --- src/content/index.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/content') diff --git a/src/content/index.js b/src/content/index.js index 12251a8..26c3840 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -83,6 +83,7 @@ window.addEventListener("keypress", (e) => { browser.runtime.sendMessage(request) .then(handleResponse) .catch((err) => { + vvConsole.showError(err.message); console.log(`Vim Vixen: ${err}`); }); }); @@ -96,12 +97,16 @@ messages.receive(window, (message) => { browser.runtime.sendMessage({ type: 'event.cmd.enter', text: message.value + }).catch((e) => { + vvConsole.showError(e.message); }); break; case 'vimvixen.command.change': browser.runtime.sendMessage({ type: 'event.cmd.suggest', text: message.value + }).catch((e) => { + vvConsole.showError(e.message); }); break; default: -- cgit v1.2.3