From 77b6a7d5bd7463f9f397179f5897ec0d00706749 Mon Sep 17 00:00:00 2001 From: Souji Date: Fri, 4 Sep 2020 12:51:15 +0200 Subject: [PATCH] fix(Util): throw token invalid for fetching rec. shard amount (#4779) --- src/util/Util.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/util/Util.js b/src/util/Util.js index 0819eea9a..d1909fd95 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -244,6 +244,7 @@ class Util { }) .then(res => { if (res.ok) return res.json(); + if (res.status === 401) throw new DiscordError('TOKEN_INVALID'); throw res; }) .then(data => data.shards * (1000 / guildsPerShard));