commit a684d5a7da79481ac1841b4e66b2b41a5fe0c88b Author: David Fifield david@bamsoftware.com Date: Sat Mar 30 02:09:06 2019 -0600
Throw an exception if headersFn is called more than once.
Re-use the catch handler. --- webextension/browser/background.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/webextension/browser/background.js b/webextension/browser/background.js index b8c5197..737c97c 100644 --- a/webextension/browser/background.js +++ b/webextension/browser/background.js @@ -168,8 +168,7 @@ async function roundtrip(params) { try { // Sanity assertion: per-request listeners are called at most once. if (headersCalled) { - console.log("headersFn called more than once"); - return {cancel: true}; + throw new Error("headersFn called more than once"); } headersCalled = true;