Skip to content

Commit

Permalink
catch some chat download exceptions
Browse files Browse the repository at this point in the history
hopefully fixes MrBrax#138
  • Loading branch information
MrBrax committed Apr 27, 2022
1 parent 1fd4ad3 commit 253f8a8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions client-vue/src/views/FilesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
<section class="section">
<div class="section-title"><h1>Clips</h1></div>
<div class="section-content">
WIP
</div>
</section>
<section class="section">
<div class="section-title"><h1>VODs</h1></div>
<div class="section-content">
WIP
</div>
</section>
</div>
Expand Down
12 changes: 11 additions & 1 deletion server/src/Controllers/Vod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,17 @@ export async function DownloadChat(req: express.Request, res: express.Response):
return;
}

const success = await vod.downloadChat();
let success;

try {
success = await vod.downloadChat();
} catch (error) {
res.status(500).send({
status: "ERROR",
message: `Chat download error: ${(error as Error).message}`,
});
return;
}

res.send({
status: success ? "OK" : "ERROR",
Expand Down
9 changes: 7 additions & 2 deletions server/src/Core/Automator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,12 @@ export class Automator {
// download chat and optionally burn it
if (this.channel.download_chat && this.vod.twitch_vod_id) {
Log.logAdvanced(LOGLEVEL.INFO, "automator", `Auto download chat on ${basename}`);
this.vod.downloadChat();

try {
await this.vod.downloadChat();
} catch (error) {
Log.logAdvanced(LOGLEVEL.ERROR, "automator", `Failed to download chat for ${basename}: ${(error as Error).message}`);
}

if (this.channel.burn_chat) {
Log.logAdvanced(LOGLEVEL.ERROR, "automator", "Automatic chat burning has been disabled until settings have been implemented.");
Expand Down Expand Up @@ -1006,7 +1011,7 @@ export class Automator {

if (data.includes("Writing output to")) {
Log.logAdvanced(LOGLEVEL.INFO, "automator", "Writing output");
if (this.vod){
if (this.vod) {
this.vod.capture_started2 = new Date();
this.vod.broadcastUpdate();
}
Expand Down

0 comments on commit 253f8a8

Please sign in to comment.