From 438c77eacb63defb951863cd86a560f08e7d1690 Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Wed, 11 Mar 2020 22:46:42 +0200 Subject: [PATCH] Update ready.js --- events/ready.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/events/ready.js b/events/ready.js index a6e2f31..e04cce3 100644 --- a/events/ready.js +++ b/events/ready.js @@ -18,8 +18,13 @@ module.exports = { } } - client.stations = await fetch('https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json') - .then(res => res.json()); + try { + client.stations = await fetch('https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json') + .then(res => res.json()); + } catch (err) { + client.stations = null; + console.error(err); + } setInterval(async () => { client.stations = await fetch('https://gitea.cwinfo.org/cwchristerw/radio/raw/branch/master/playlist.json')