Show Nominatim 403 error to user in Web UI

Closes #5

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Edward Betts 2026-02-18 19:41:31 +00:00
parent 0d2cfd56cb
commit ea2b3c18d8
2 changed files with 6 additions and 1 deletions

View file

@ -653,7 +653,10 @@ def api_missing_wikidata_items():
@app.route("/api/1/search")
def api_search():
q = flask.request.args["q"]
hits = nominatim.lookup(q)
try:
hits = nominatim.lookup(q)
except nominatim.SearchError as e:
return cors_jsonify({"success": False, "error": str(e)}, 503)
for hit in hits:
hit["name"] = nominatim.get_hit_name(hit)
hit["label"] = nominatim.get_hit_label(hit)