Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
add cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
takayama-lily committed Jul 3, 2022
1 parent 211bc18 commit 56a95df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/highway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@ export function highwayHttpUpload(this: Client, readable: stream.Readable, obj:
readable.on("err", reject)
.on("end", () => {
Promise.all(tasks).then(resolve).catch(err => {
if (err instanceof axios.Cancel === false)
if (err instanceof axios.Cancel === false) {
cancels.forEach(c => c.cancel())
reject(err)
}
resolve(undefined)
})
})
Expand Down

0 comments on commit 56a95df

Please sign in to comment.