Skip to content

Commit

Permalink
fix: WebFileReadStream no throw error when filereader onerror (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
weiyie authored Jul 13, 2020
1 parent 4b8edf6 commit d4977bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/managed-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ WebFileReadStream.prototype._read = function _read(size) {
that.file = null;
that.readFileAndPush(size);
};
this.reader.onerror = function onload(e) {
const error = e.srcElement && e.srcElement.error;
if (error) {
throw error;
}
throw e;
};

if (this.start === 0) {
this.reader.readAsArrayBuffer(this.file);
Expand Down

0 comments on commit d4977bf

Please sign in to comment.