Improved error handling for file uploads

This commit is contained in:
n1474335 2018-01-04 14:43:49 +00:00
parent 0ba28dc891
commit d38375a08c
2 changed files with 8 additions and 0 deletions

View file

@ -214,6 +214,10 @@ InputWaiter.prototype.handleLoaderMessage = function(e) {
fileLoaded.textContent = r.progress + "%";
}
if (r.hasOwnProperty("error")) {
this.app.alert(r.error, "danger", 10000);
}
if (r.hasOwnProperty("fileBuffer")) {
log.debug("Input file loaded");
this.fileBuffer = r.fileBuffer;

View file

@ -46,5 +46,9 @@ self.loadFile = function(file) {
seek();
};
reader.onerror = function(e) {
self.postMessage({"error": file.error.message});
};
seek();
};