fix: distinguish failed sources from empty results
CI (SIAX Cloud) / integration (push) Skipped
CI (SIAX Cloud) / sonar (push) Skipped
masterplan-lock / check (push) Successful in 4s
CI (SIAX Cloud) / sonar (pull_request) Skipped
CI (SIAX Cloud) / security (push) Successful in 15s
masterplan-lock / check (pull_request) Successful in 7s
Security Scan (SIAX Cloud) / security (push) Successful in 18s
Security Scan (SIAX Cloud) / security (pull_request) Successful in 17s
CI (SIAX Cloud) / security (pull_request) Successful in 20s
CI (SIAX Cloud) / integration (pull_request) Successful in 35s
CI (SIAX Cloud) / quality (pull_request) Successful in 39s
CI (SIAX Cloud) / quality (push) Successful in 48s

This commit is contained in:
2026-11-02 06:58:15 +01:00
parent 4f5a2ea865
commit 5137bf87a1
6 changed files with 156 additions and 56 deletions
+7 -6
View File
@@ -169,17 +169,18 @@ async def sources_for(market: str):
async def vehicle(plate: str):
try:
v = await rdw_vehicle(plate)
except Exception:
v = None
return v or {"vehicle": None}
except Exception as exc:
raise HTTPException(status_code=503, detail="vehicle source unavailable") from exc
return {**(v or {"vehicle": None}), "source_status": "ok"}
@app.get("/screen")
async def screen(q: str):
try:
return await opensanctions_screen(q)
except Exception:
return {"matches": [], "source": "opensanctions"}
result = await opensanctions_screen(q)
return {**result, "source_status": "ok"}
except Exception as exc:
raise HTTPException(status_code=503, detail="screening source unavailable") from exc
@app.post("/estimates")