Skip to content

Commit

Permalink
fix: error handling (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
catouberos authored Nov 26, 2023
1 parent 187c0aa commit 7e1eb46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ export default {

break;
case "0 5-17/12 * * *":
await runRegistriesCheck(env);
try {
await runRegistriesCheck(env);
} catch (e) {
await sendWebhook(env.DEBUG_WEBHOOK_URL, {
embeds: [{
title: "Error",
description: e
}]
});
}
break;
}
},
Expand Down
2 changes: 2 additions & 0 deletions src/jobs/ppdvn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export async function runRegistriesCheck(env: Env) {
break;
}

if (!webhookUrl) continue;

await sendRegistriesWebhook(webhookUrl, data[publisher as Publisher]);
}

Expand Down

0 comments on commit 7e1eb46

Please sign in to comment.