mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-22 12:01:15 -04:00
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.
This commit is contained in:
parent
5f7d32d1f8
commit
52eabb318a
@ -489,6 +489,9 @@ define(function(require) {
|
|||||||
try {
|
try {
|
||||||
var compressedArticles = e.target.result;
|
var compressedArticles = e.target.result;
|
||||||
webworkerBzip2.onerror = function(event){
|
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 + ")");
|
throw new Error(event.message + " (" + event.filename + ":" + event.lineno + ")");
|
||||||
};
|
};
|
||||||
webworkerBzip2.onmessage = function(event){
|
webworkerBzip2.onmessage = function(event){
|
||||||
@ -517,6 +520,9 @@ define(function(require) {
|
|||||||
console.log(event.data.msg);
|
console.log(event.data.msg);
|
||||||
break;
|
break;
|
||||||
case "error":
|
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);
|
throw new Error(event.data.msg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user