Add debug details to Discord API errors

This commit is contained in:
Jorge Vargas 2025-03-21 15:24:29 -06:00
parent 210118bf4d
commit 24fb8f2b7d
2 changed files with 2 additions and 2 deletions

View file

@ -74,6 +74,6 @@
"discordNeeded": "You need to link your Discord account to access this page", "discordNeeded": "You need to link your Discord account to access this page",
"discordRoleNeeded": "You need the Donator Discord role to access this page", "discordRoleNeeded": "You need the Donator Discord role to access this page",
"addedDonator": "Added donator benefits to your account!", "addedDonator": "Added donator benefits to your account!",
"errorDonatorCheck": "Something went wrong when checking your Discord donator status. Please try again later.", "errorDonatorCheck": "Something went wrong when checking your Discord donator status. Please try again later. {error}",
"discordRateLimit": "{message} Retry after {retry_after} seconds." "discordRateLimit": "{message} Retry after {retry_after} seconds."
} }

View file

@ -33,7 +33,7 @@ async function getMessage() {
const { message, retry_after }: { message: string; retry_after: number } = await memberInfoRes.json() const { message, retry_after }: { message: string; retry_after: number } = await memberInfoRes.json()
return m.discordRateLimit({ message, retry_after }) return m.discordRateLimit({ message, retry_after })
} else if (memberInfoRes.status != 200) { } else if (memberInfoRes.status != 200) {
return m.errorDonatorCheck return m.errorDonatorCheck({ error: await memberInfoRes.json() })
} }
const memberInfo: { roles: string[] } = await memberInfoRes.json() const memberInfo: { roles: string[] } = await memberInfoRes.json()