mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-10 23:56:22 +08:00
added custom error handling
This commit is contained in:
parent
85835334d1
commit
2aa95b4526
1 changed files with 6 additions and 0 deletions
|
@ -184,6 +184,12 @@ async function authenticateWithBearerToken(
|
|||
"Token revoked. Please login again.",
|
||||
"authenticateWithBearerToken"
|
||||
);
|
||||
} else if (errorCode?.includes("auth/user-not-found")) {
|
||||
throw new MonkeyError(
|
||||
401,
|
||||
"User not found.",
|
||||
"authenticateWithBearerToken"
|
||||
);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue