From a7376adb681bd6821f9af6fc6e56f734fcc5c2e7 Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Fri, 16 Apr 2021 13:21:53 -0500 Subject: fix error that happens sometimes --- src/hypixelApi.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hypixelApi.ts b/src/hypixelApi.ts index f072d11..ee63155 100644 --- a/src/hypixelApi.ts +++ b/src/hypixelApi.ts @@ -137,12 +137,14 @@ export async function sendApiRequest({ path, key, args }): Promise httpsAgent } ) + fetchJsonParsed = await fetchResponse.json() } catch { // if there's an error, wait a second and try again await new Promise((resolve) => setTimeout(resolve, 1000)) @@ -157,7 +159,6 @@ export async function sendApiRequest({ path, key, args }): Promise