swadhinbiswas

[email protected]
2026-09-14 18:12:01 +0600 committed NaN years ago
0cecd80
commit 0cecd80
1 file changed
+7 -0
Showing 1 changed file+7-0
▼services/sources/airlabs.py
+7-0
142
142
payload = res.json()
143
143
except ValueError:
144
144
return []
145
+ if isinstance(payload, dict) and payload.get("error"):
146
+ # AirLabs answers 200 with an error object for plan/permission and
147
+ # parameter problems; treating that as "no flights" hid the cause.
148
+ error = payload["error"]
149
+ message = error.get("message") if isinstance(error, dict) else str(error)
150
+ logger.warning("[airlabs] %s=%s rejected: %s", key, value, message)
151
+ return []
145
152
rows = payload.get("response") if isinstance(payload, dict) else payload
146
153
return rows if isinstance(rows, list) else []
147
154
148
155