mirror of
https://github.com/maxswa/osrs-json-hiscores.git
synced 2025-10-15 10:19:04 +00:00
Merge pull request #8 from maxswa/bug/rsn-format-error
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('hardcore', rsn)).catch(err => err),
|
||||
axios(getStatsURL('ultimate', rsn)).catch(err => err),
|
||||
getRSNFormat(rsn),
|
||||
getRSNFormat(rsn).catch(() => undefined),
|
||||
]);
|
||||
|
||||
const [ironRes, hcRes, ultRes, formattedName] = otherResponses;
|
||||
|
||||
const player: Player = {
|
||||
name: formattedName,
|
||||
name: formattedName || rsn,
|
||||
mode: 'main',
|
||||
dead: false,
|
||||
deulted: false,
|
||||
|
Reference in New Issue
Block a user