diff --git a/src/api.js b/src/api.js index 57a7b8a..464313a 100644 --- a/src/api.js +++ b/src/api.js @@ -5,6 +5,7 @@ const DEV_KEY = import.meta.env.VITE_FOOTBALL_API_KEY export function apiFetch(path) { const headers = DEV_KEY ? { 'X-Auth-Token': DEV_KEY } : {} return fetch(`/api${path}`, { headers }).then((res) => { + if (res.status === 429) throw new Error('Limiet bereikt: het gratis abonnement staat maximaal 10 verzoeken per minuut toe. Wacht even en probeer het opnieuw.') if (!res.ok) throw new Error(`API error: ${res.status} ${res.statusText}`) return res.json() })