mirror of
https://github.com/maxswa/osrs-json-hiscores.git
synced 2025-10-15 10:19:04 +00:00
Add catch for getRSNFormat error.
This commit is contained in:
@@ -46,13 +46,13 @@ export async function getStats(rsn: string): Promise<Player> {
|
|||||||
axios(getStatsURL('ironman', rsn)).catch(err => err),
|
axios(getStatsURL('ironman', rsn)).catch(err => err),
|
||||||
axios(getStatsURL('hardcore', rsn)).catch(err => err),
|
axios(getStatsURL('hardcore', rsn)).catch(err => err),
|
||||||
axios(getStatsURL('ultimate', rsn)).catch(err => err),
|
axios(getStatsURL('ultimate', rsn)).catch(err => err),
|
||||||
getRSNFormat(rsn),
|
getRSNFormat(rsn).catch(() => undefined),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const [ironRes, hcRes, ultRes, formattedName] = otherResponses;
|
const [ironRes, hcRes, ultRes, formattedName] = otherResponses;
|
||||||
|
|
||||||
const player: Player = {
|
const player: Player = {
|
||||||
name: formattedName,
|
name: formattedName || rsn,
|
||||||
mode: 'main',
|
mode: 'main',
|
||||||
dead: false,
|
dead: false,
|
||||||
deulted: false,
|
deulted: false,
|
||||||
|
Reference in New Issue
Block a user