Skip to content

Commit

Permalink
Merge pull request #45 from Lumen5/LU-3058-handle-timeout
Browse files Browse the repository at this point in the history
fix(*): handle timeout
  • Loading branch information
stepancar committed Oct 18, 2023
2 parents d235d37 + 840c460 commit 8c2d26e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/DownloadVideoURL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export class DownloadVideoURL {
}
reject(e);
});

this.#httpRequest.on('timeout', () => {
this.#httpRequest.destroy();
reject(new Error(`Request to ${source} timed out`));
});
}
catch (e) {
reject(e);
Expand Down

0 comments on commit 8c2d26e

Please sign in to comment.