Remove unnecessary type cast

This commit is contained in:
seditionist
2023-11-26 17:43:38 -05:00
parent 66528cd9d9
commit 546bc5acf7

View File

@@ -66,11 +66,9 @@ export async function getOfficialStats(
const response = await httpGet<HiscoresResponse>(url, config);
return response.data;
} catch (err) {
const error = err as Error | AxiosError;
if (!axios.isAxiosError(err)) throw err;
if (!axios.isAxiosError(error)) throw err;
if (error.response?.status === 404) throw new PlayerNotFoundError();
if (err.response?.status === 404) throw new PlayerNotFoundError();
throw new HiScoresError();
}
@@ -103,7 +101,7 @@ export async function getRSNFormat(
return rsnFromElement(anchor);
}
throw new PlayerNotFoundError();
} catch (err) {
} catch {
throw new HiScoresError();
}
}