Explorar o código

log ignored error

Gildas %!s(int64=7) %!d(string=hai) anos
pai
achega
2811f127c4
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      lib/browser-polyfill/custom-browser-polyfill.js

+ 6 - 1
lib/browser-polyfill/custom-browser-polyfill.js

@@ -81,7 +81,12 @@
 					addListener: listener => chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
 						const response = listener(message, sender);
 						if (response && typeof response.then == "function") {
-							response.then(sendResponse);
+							response.then(response => {
+								sendResponse(response);
+								if (chrome.runtime.lastError) {
+									console.error(chrome.runtime.lastError); // eslint-disable-line no-console
+								}
+							});
 							return true;
 						}
 					}),