improved error reporting

This commit is contained in:
Alex Yatskov 2017-09-22 19:57:00 -07:00
parent 8ba8397170
commit 7a6e2925bd
4 changed files with 4 additions and 4 deletions

View File

@ -71,7 +71,7 @@ class Backend {
return promise.then(result => {
callback({result});
}).catch(error => {
callback({error});
callback({error: error.toString ? error.toString() : error});
});
};

View File

@ -29,7 +29,7 @@ class DisplaySearch extends Display {
}
onError(error) {
window.alert(`Error: ${error}`);
window.alert(`Error: ${error.toString ? error.toString() : error}`);
}
onSearchClear() {

View File

@ -27,7 +27,7 @@ class DisplayFloat extends Display {
if (window.yomichan_orphaned) {
this.onOrphaned();
} else {
window.alert(`Error: ${error}`);
window.alert(`Error: ${error.toString ? error.toString() : error}`);
}
}

View File

@ -152,7 +152,7 @@ class Frontend {
}
onError(error) {
window.alert(`Error: ${error}`);
window.alert(`Error: ${error.toString ? error.toString() : error}`);
}
popupTimerSet(callback) {