mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 12:19:46 -04:00
Add error reporting
Former-commit-id: 204781255b87688972b6d61be9ec4a3d5a42c3ea
This commit is contained in:
parent
b2bc9dae1c
commit
ccbefb39c7
@ -848,7 +848,7 @@ define(rqDef, function(util) {
|
||||
if (providerAPI) {
|
||||
providerAPI.innerHTML = 'Search Provider: ' + (/^fulltext/.test(provider) ? 'Title + Xapian [' + provider :
|
||||
'Title only [' + provider) + ']';
|
||||
providerAPI.className = /^fulltext/.test(provider) ? 'apiAvailable' : 'apiUnavailable';
|
||||
providerAPI.className = /^fulltext/.test(provider) ? 'apiAvailable' : !/ERROR/.test(provider) ? 'apiUnavailable' : 'apiBroken';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ define(['zimfile', 'zimDirEntry', 'transformZimit', 'util', 'uiUtil', 'utf8'],
|
||||
// Update the API panel
|
||||
uiUtil.reportSearchProviderToAPIStatusPanel(params.searchProvider);
|
||||
}).catch(function (err) {
|
||||
uiUtil.reportSearchProviderToAPIStatusPanel(params.searchProvider);
|
||||
uiUtil.reportSearchProviderToAPIStatusPanel(params.searchProvider + ': ERROR');
|
||||
console.error('The libzim worker could not be instantiated!', err);
|
||||
});
|
||||
} else {
|
||||
@ -113,7 +113,7 @@ define(['zimfile', 'zimDirEntry', 'transformZimit', 'util', 'uiUtil', 'utf8'],
|
||||
params.searchProvider += ': no_fulltext'; message += 'this ZIM does not have a full-text index.';
|
||||
} else if (isSplitZim) {
|
||||
params.searchProvider += ': split_zim'; message += 'the ZIM archive is split.';
|
||||
} else {
|
||||
} else if (typeof Atomics === 'undefined') {
|
||||
params.searchProvider += ': no_atomics'; message += 'this browser does not support Atomic operations.';
|
||||
}
|
||||
uiUtil.reportSearchProviderToAPIStatusPanel(params.searchProvider);
|
||||
|
Loading…
x
Reference in New Issue
Block a user