Skip to content

Commit

Permalink
fix(*): handle timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
stepancar committed Oct 18, 2023
1 parent d235d37 commit 840c460
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 840c460

Please sign in to comment.