Skip to content

Commit

Permalink
fix connection lost error (fix #414)
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed May 16, 2023
1 parent edbac5d commit 24e79b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/core/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function sendXMLHttpRequest(method, { url }, headers) {
reject(request.status == 416 ? new Error(ERR_HTTP_RANGE) : new Error(ERR_HTTP_STATUS + (request.statusText || request.status)));
}
}, false);
request.addEventListener("error", event => reject(event.detail.error), false);
request.addEventListener("error", event => reject(event.detail ? event.detail.error : new Error("Network error")), false);
request.open(method, url);
if (headers) {
for (const entry of Object.entries(headers)) {
Expand Down

0 comments on commit 24e79b8

Please sign in to comment.