Skip to content

Commit 15ce5b4

Browse files
authored
fix: change abort listener to aborted event (#8282)
1 parent 5fae1cf commit 15ce5b4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/strong-spiders-grab.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"electron-updater": patch
3+
---
4+
5+
fix aborted event

packages/electron-updater/src/differentialDownloader/DifferentialDownloader.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export abstract class DifferentialDownloader {
233233

234234
const request = this.httpExecutor.createRequest(requestOptions, response => {
235235
response.on("error", reject)
236-
response.on("abort", () => {
236+
response.on("aborted", () => {
237237
reject(new Error("response has been aborted by the server"))
238238
})
239239
// Electron net handles redirects automatically, our NodeJS test server doesn't use redirects - so, we don't check 3xx codes.
@@ -295,6 +295,11 @@ export abstract class DifferentialDownloader {
295295
return
296296
}
297297

298+
response.on("error", reject)
299+
response.on("aborted", () => {
300+
reject(new Error("response has been aborted by the server"))
301+
})
302+
298303
response.on("data", dataHandler)
299304
response.on("end", () => resolve())
300305
})

0 commit comments

Comments
 (0)