diff --git a/src/components/client/StatsPage.tsx b/src/components/client/StatsPage.tsx index 7eea9d85..ed1c92e6 100644 --- a/src/components/client/StatsPage.tsx +++ b/src/components/client/StatsPage.tsx @@ -180,7 +180,7 @@ const StatsPage = () => { fontWeight="semibold" > { + if (!res.ok) throw new Error('Reddit API failed') + return res.json() + }) + const twitterResponse = await fetch(url, options).then((res) => { + if (!res.ok) throw new Error('Twitter API failed') + return res.json() + }) const { followers_count: twitterFollowers } = await twitterResponse.json() const redditData = await redditResponse.json()