aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/background/infrastructures/content-message-listener.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/background/infrastructures/content-message-listener.js b/src/background/infrastructures/content-message-listener.js
index 277d108..2fa5f54 100644
--- a/src/background/infrastructures/content-message-listener.js
+++ b/src/background/infrastructures/content-message-listener.js
@@ -18,14 +18,12 @@ export default class ContentMessageListener {
run() {
browser.runtime.onMessage.addListener((message, sender) => {
- try {
- return this.onMessage(message, sender);
- } catch (e) {
+ return this.onMessage(message, sender).catch((e) => {
return browser.tabs.sendMessage(sender.tab.id, {
type: messages.CONSOLE_SHOW_ERROR,
text: e.message,
});
- }
+ });
});
}