Skip to content

Commit

Permalink
Include ignored Discord errors in summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckyz committed Nov 30, 2023
1 parent 66dbe7e commit 8e1546b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion scripts/generateReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ async function printReport() {

console.log();

report.otherErrors = report.otherErrors.filter(e => !IGNORED_DISCORD_ERRORS.some(regex => e.match(regex)));
const ignoredErrors = [] as string[];
report.otherErrors = report.otherErrors.filter(e => {
if (IGNORED_DISCORD_ERRORS.some(regex => e.match(regex))) {
ignoredErrors.push(e);
return false;
}
return true;
});

console.log("## Discord Errors");
report.otherErrors.forEach(e => {
Expand All @@ -114,6 +121,13 @@ async function printReport() {

console.log();

console.log("## Ignored Discord Errors");
ignoredErrors.forEach(e => {
console.log(`- ${toCodeBlock(e)}`);
});

console.log();

if (process.env.DISCORD_WEBHOOK) {
await fetch(process.env.DISCORD_WEBHOOK, {
method: "POST",
Expand Down

0 comments on commit 8e1546b

Please sign in to comment.