Spaces:
Sleeping

File size: 457 Bytes
43280d3
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
// 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"
  }
}