From 08fd41d83e84ff9af21b3a456f1ba4207b9f9a5b Mon Sep 17 00:00:00 2001 From: weiyie <912881342@qq.com> Date: Tue, 30 Jun 2020 11:44:36 +0800 Subject: [PATCH] fix: WebFileReadStream no throw error when filereader onerror --- lib/managed-upload.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/managed-upload.js b/lib/managed-upload.js index 134fab7aa..c134f8080 100644 --- a/lib/managed-upload.js +++ b/lib/managed-upload.js @@ -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);