From 52eabb318a73588c3ec82d4816bd913c61b8e6ab Mon Sep 17 00:00:00 2001 From: mossroy Date: Fri, 2 Aug 2013 09:57:31 +0200 Subject: [PATCH] When an error is thrown from bzip2 decoding, display the error message to the user, so that he does not wait forever for the spinner to stop. And ask the user to report the issue to us. --- js/lib/archive.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/lib/archive.js b/js/lib/archive.js index 118ba695..c2c3f848 100644 --- a/js/lib/archive.js +++ b/js/lib/archive.js @@ -489,6 +489,9 @@ define(function(require) { try { var compressedArticles = e.target.result; webworkerBzip2.onerror = function(event){ + // TODO can probably be replaced by some error handler at window level + alert("An unexpected error occured. Please report it to us by email or through Github (see About section), with the name of the article and the following info : event.message=" + + event.message + " event.filename=" + event.filename + " event.lineno=" + event.lineno ); throw new Error(event.message + " (" + event.filename + ":" + event.lineno + ")"); }; webworkerBzip2.onmessage = function(event){ @@ -517,6 +520,9 @@ define(function(require) { console.log(event.data.msg); break; case "error": + // TODO can probably be replaced by some error handler at window level + alert("An unexpected error occured. Please report it to us by email or through Github (see About section), with the name of the article and the following info : event.data.msg=" + + event.data.msg ); throw new Error(event.data.msg); break; }