Skip to content
This repository was archived by the owner on Nov 24, 2020. It is now read-only.

Commit b2f6de0

Browse files
authored
Merge pull request #64 from renatovassao/fix/handleHttpAbortedEvent
fix: handle 'aborted' http response event
2 parents a66ba6c + 4c82c24 commit b2f6de0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/target/typescript_nodeclient.cr

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ END
113113
reject({type: "BadFormattedResponse", message: `Response couldn't be parsed as JSON (${data}):\\n${e.toString()}`});
114114
}
115115
});
116-
116+
resp.on("aborted", () => {
117+
console.error("Request aborted");
118+
reject({type: "Fatal", message: "Request aborted"});
119+
});
117120
});
118121
119122
req.on("error", (e) => {

0 commit comments

Comments
 (0)