Skip to content

Commit

Permalink
fix: add timeout event
Browse files Browse the repository at this point in the history
  • Loading branch information
fupengl authored Jan 27, 2021
1 parent 653a094 commit 93f6199
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export default function upload(option: UploadRequestOption) {
xhr.onerror = function error(e) {
option.onError(e);
};

xhr.ontimeout = function timeout(e) {
option.onError(e);
};

xhr.onload = function onload() {
// allow success when 2xx status
Expand Down

0 comments on commit 93f6199

Please sign in to comment.