Skip to content

Commit

Permalink
Update lib/parser.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rbren authored Feb 12, 2024
1 parent b096753 commit 33e1408
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ class Parser {
})
req.on('error', reject);
timeout = setTimeout(() => {
req.destroy(new Error("Request timed out after " + this.options.timeout + "ms"));
let err = new Error("Request timed out after " + this.options.timeout + "ms");
req.destroy(err);
reject(err);
}, this.options.timeout);
}).then(data => {
clearTimeout(timeout);
Expand Down

0 comments on commit 33e1408

Please sign in to comment.