mirror of
https://github.com/maxswa/osrs-json-hiscores.git
synced 2025-10-15 10:19:04 +00:00
Remove unnecessary type cast
This commit is contained in:
@@ -66,11 +66,9 @@ export async function getOfficialStats(
|
|||||||
const response = await httpGet<HiscoresResponse>(url, config);
|
const response = await httpGet<HiscoresResponse>(url, config);
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const error = err as Error | AxiosError;
|
if (!axios.isAxiosError(err)) throw err;
|
||||||
|
|
||||||
if (!axios.isAxiosError(error)) throw err;
|
if (err.response?.status === 404) throw new PlayerNotFoundError();
|
||||||
|
|
||||||
if (error.response?.status === 404) throw new PlayerNotFoundError();
|
|
||||||
|
|
||||||
throw new HiScoresError();
|
throw new HiScoresError();
|
||||||
}
|
}
|
||||||
@@ -103,7 +101,7 @@ export async function getRSNFormat(
|
|||||||
return rsnFromElement(anchor);
|
return rsnFromElement(anchor);
|
||||||
}
|
}
|
||||||
throw new PlayerNotFoundError();
|
throw new PlayerNotFoundError();
|
||||||
} catch (err) {
|
} catch {
|
||||||
throw new HiScoresError();
|
throw new HiScoresError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user