Skip to content

Commit 0a9117c

Browse files
GamerPower: throw error on missing URLs
1 parent 137ef4c commit 0a9117c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

epic-games.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ try {
222222
const gpUrlNormalized = gpUrl.split('?')[0].replace(/\/$/, '');
223223
const found = urls.some(url => url.split('?')[0].replace(/\/$/, '') === gpUrlNormalized);
224224
if (!found) {
225-
console.error(`[GamerPower] ERROR: ${gpUrl} is NOT in Epic's free games list!`);
226-
console.error(`[GamerPower] Epic's free games: ${urls.join(', ')}`);
225+
throw new Error(`[GamerPower] ${gpUrl} is NOT in Epic's free games list! Epic's free games: ${urls.join(', ')}`);
227226
} else {
228227
console.log(`[GamerPower] OK: ${gpUrl}`);
229228
}

gog.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ try {
173173
const gpSlug = gpMatch ? gpMatch[1] : gpUrl.split('/').pop();
174174
const found = url && url.includes(gpSlug);
175175
if (!found) {
176-
console.error(`[GamerPower] ERROR: ${gpUrl} does NOT match GOG's current giveaway!`);
177-
console.error(`[GamerPower] GOG's current giveaway: ${url}`);
176+
throw new Error(`[GamerPower] ${gpUrl} does NOT match GOG's current giveaway: ${url}`);
178177
} else {
179178
console.log(`[GamerPower] OK: ${gpUrl}`);
180179
}

0 commit comments

Comments
 (0)