Spaces:
Running
Running
Download frontend/lib/errors.ts from shivamkr00902/data2: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/spaces/shivamkr00902/data2/resolve/main/frontend/lib/errors.ts
- Command line
-
hf download hf://spaces/shivamkr00902/data2/frontend/lib/errors.ts
-
curl -L -o errors.ts https://huggingface.co/spaces/shivamkr00902/data2/resolve/main/frontend/lib/errors.ts
1.19 kB
| export function errorGuidance(status?: number, code?: string): string { | |
| if (code === "account_suspended") | |
| return "Contact the gateway administrator to restore your account."; | |
| if (code === "admin_required") | |
| return "Use an account with an administrator role granted on the server."; | |
| if (status === 402) | |
| return "The provider requires payment or available credit. Check the provider account's billing and model access."; | |
| if (status === 401 || status === 403) | |
| return "Check the selected provider's credentials and access permissions. For a session error, sign in again."; | |
| if (status === 429) | |
| return "Wait for the rate-limit window to reset, or choose another available model."; | |
| if (status === 404 || code === "no_matching_model") | |
| return "Choose an available model or refresh the provider catalog. Check the required capabilities."; | |
| if (status === 400 || status === 422) | |
| return "Review the selected model and request settings before sending again."; | |
| if (status === 413) return "Shorten the prompt or reduce the request size."; | |
| return "The request could not complete. Retry later or choose another model; request details show the provider attempts."; | |
| } | |