Spaces:
Sleeping
Sleeping
Download epl-predictor/src/lib/errors.ts from otito254/epl-predictor-api: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/spaces/otito254/epl-predictor-api/resolve/main/epl-predictor/src/lib/errors.ts
- Command line
-
hf download hf://spaces/otito254/epl-predictor-api/epl-predictor/src/lib/errors.ts
-
curl -L -o errors.ts https://huggingface.co/spaces/otito254/epl-predictor-api/resolve/main/epl-predictor/src/lib/errors.ts
457 Bytes
| // src/lib/errors.ts | |
| export function getFriendlyError(err: Error & { status?: number }): string { | |
| switch (err.status) { | |
| case 503: return "Service unavailable — model training may be in progress" | |
| case 404: return "Team not recognised — check spelling" | |
| case 422: return "Invalid request — check your inputs" | |
| case 502: return "Live odds unavailable — try again shortly" | |
| default: return err.message ?? "Something went wrong" | |
| } | |
| } |