Skip to content

Commit 9073fde

Browse files
author
Sergey Koryshev
committed
subscribed on 'aborted' event as well
1 parent e379eeb commit 9073fde

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tool.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ export async function downloadTool(
258258
file.end();
259259
reject(err);
260260
})
261+
.on('aborted', () => {
262+
// this block is for Node10 compatibility since it doesn't emit 'error' event after 'aborted' one
263+
file.end();
264+
reject(new Error('Aborted'));
265+
})
261266
.pipe(file);
262267
} catch (err) {
263268
reject(err);

0 commit comments

Comments
 (0)