mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-09-11 09:06:36 +08:00
refactor: add firebase 500 handling
This commit is contained in:
parent
47c8668069
commit
8942ee2813
1 changed files with 7 additions and 1 deletions
|
@ -116,7 +116,7 @@ export async function sendVerificationEmail(
|
|||
if (e.code === "auth/user-not-found") {
|
||||
throw new MonkeyError(
|
||||
500,
|
||||
"Auth user not found when the user was found in the database",
|
||||
"Auth user not found when the user was found in the database. Contact support with this error message and your email",
|
||||
JSON.stringify({
|
||||
decodedTokenEmail: email,
|
||||
userInfoEmail: userInfo.email,
|
||||
|
@ -125,6 +125,12 @@ export async function sendVerificationEmail(
|
|||
userInfo.uid
|
||||
);
|
||||
}
|
||||
if (e.message.includes("Internal error encountered.")) {
|
||||
throw new MonkeyError(
|
||||
500,
|
||||
"Firebase failed to generate an email verification link. Please try again later."
|
||||
);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue