Download client/src/utils/getLoginError.ts from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 558 Bytes
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/client/src/utils/getLoginError.ts
- Command line
-
hf download hf://spaces/Zhitomir/chat/client/src/utils/getLoginError.ts
-
curl -L -o getLoginError.ts https://huggingface.co/spaces/Zhitomir/chat/resolve/main/client/src/utils/getLoginError.ts
558 Bytes
| const getLoginError = (errorText: string) => { | |
| const defaultError = 'com_auth_error_login'; | |
| if (!errorText) { | |
| return defaultError; | |
| } | |
| switch (true) { | |
| case errorText.includes('429'): | |
| return 'com_auth_error_login_rl'; | |
| case errorText.includes('403'): | |
| return 'com_auth_error_login_ban'; | |
| case errorText.includes('500'): | |
| return 'com_auth_error_login_server'; | |
| case errorText.includes('422'): | |
| return 'com_auth_error_login_unverified'; | |
| default: | |
| return defaultError; | |
| } | |
| }; | |
| export default getLoginError; | |