TypeError: String includes not contains, #53; only first line of error

This commit is contained in:
Ralf Vogler 2023-01-29 19:28:02 +01:00
parent d7e5cc4a3a
commit c5b0065a50
3 changed files with 6 additions and 6 deletions

View file

@ -177,8 +177,8 @@ try {
await page.locator(games_sel).screenshot({ path: p });
} catch (error) {
console.error(error); // .toString()?
if (error.message && !error.message.contains('Target closed')) // e.g. when killed by Ctrl-C
notify(`prime-gaming failed: ${error.message}`);
if (error.message && !error.message.includes('Target closed')) // e.g. when killed by Ctrl-C
notify(`prime-gaming failed: ${error.message.split('\n')[0]}`);
} finally {
await db.write(); // write out json db
if (notify_games.length) { // list should only include claimed games