eg: catch timeout in case there are no free games available, #210
This commit is contained in:
parent
28a1e42cc4
commit
0ab9935fb5
1 changed files with 7 additions and 1 deletions
|
|
@ -123,7 +123,13 @@ try {
|
|||
|
||||
// Detect free games
|
||||
const game_loc = page.locator('a:has(span:text-is("Free Now"))');
|
||||
await game_loc.last().waitFor();
|
||||
await game_loc.last().waitFor().catch(_ => {
|
||||
// rarely there are no free games available -> catch Timeout
|
||||
// TODO would be better to wait for alternative like 'coming soon' instead of waiting for timeout
|
||||
// see https://github.com/vogler/free-games-claimer/issues/210#issuecomment-1727420943
|
||||
console.error('Seems like currently there are no free games available in your region...')
|
||||
// urls below should then be an empty list
|
||||
});
|
||||
// clicking on `game_sel` sometimes led to a 404, see https://github.com/vogler/free-games-claimer/issues/25
|
||||
// debug showed that in those cases the href was still correct, so we `goto` the urls instead of clicking.
|
||||
// Alternative: parse the json loaded to build the page https://store-site-backend-static-ipv4.ak.epicgames.com/freeGamesPromotions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue