mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-05 22:28:01 +08:00
chore: catch firebase internal errors when trying to auth
This commit is contained in:
parent
8843c50d71
commit
2d008461ed
1 changed files with 11 additions and 0 deletions
|
@ -191,6 +191,17 @@ async function authenticateWithBearerToken(
|
|||
email: decodedToken.email ?? "",
|
||||
};
|
||||
} catch (error) {
|
||||
if (
|
||||
error instanceof Error &&
|
||||
error.message.includes("An internal error has occurred")
|
||||
) {
|
||||
throw new MonkeyError(
|
||||
503,
|
||||
"Firebase returned an internal error when trying to verify the token.",
|
||||
"authenticateWithBearerToken"
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
const errorCode = error?.errorInfo?.code as string | undefined;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue