# Fehlerbehandlung

Fehler bei Warnungen und NOTAMs im Produktivbetrieb behandeln — leere Ergebnisse, abgelaufene Meldungen und Fallbacks.



TTLs für den Produktivbetrieb: [Caching & Monitoring](/docs/v31/alerts-integration-production). Plattformweite Fehler: [Fehlerbehandlung](/docs/errors).

### NOTAMs [#notams]

`GET /notams/{icao}` liefert **200** mit `notams: []`, wenn keine aktiven Meldungen vorliegen — das ist kein Fehler. Dreistellige US-Codes werden normalisiert (`JFK` → `KJFK`).

Filtern Sie clientseitig nach `scope` und `type`; die API liefert alle aktiven Meldungen für den Standort.

### FAA-Verspätungen [#faa-delays]

`total_alerts: 0` mit einem optionalen `message`-String ist eine gültige Antwort im Sinne von „keine aktiven Programme“. Die Abdeckung umfasst &#x2A;*ausschließlich das US-amerikanische [FAA NAS](https://www.faa.gov/about/office_org/headquarters_offices/ato/service_units/operations/at_delay_info)** — internationale Flughäfen erscheinen hier nicht.

```python
import os

import requests

HEADERS = {
    "X-RapidAPI-Key": os.getenv("RAPIDAPI_KEY", "YOUR_RAPIDAPI_KEY"),
    "X-RapidAPI-Host": "skylink-api.p.rapidapi.com",
}
BASE = "https://skylink-api.p.rapidapi.com"


def fetch_notams(icao: str) -> list[dict]:
    r = requests.get(f"{BASE}/notams/{icao}", headers=HEADERS, timeout=(10, 15))
    r.raise_for_status()
    return r.json().get("notams") or []


def fetch_faa_delays() -> dict:
    r = requests.get(f"{BASE}/delays/faa", headers=HEADERS, timeout=(10, 15))
    r.raise_for_status()
    return r.json()


if __name__ == "__main__":
    notams = fetch_notams("KJFK")
    print(f"KJFK NOTAMs: {len(notams)} active")

    delays = fetch_faa_delays()
    total = delays.get("total_alerts", 0)
    if total == 0:
        print("No active FAA delay programs nationwide.")
    else:
        print(f"Active FAA alerts: {total}")
```

***

Siehe auch: [NOTAMs](/docs/v31/notams-integration) · [FAA-Verspätungen](/docs/v31/faa-delays-integration) · [Caching & Monitoring](/docs/v31/alerts-integration-production)
