]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/server/starlette/server.py
fix error message for non-existing database
[nominatim.git] / nominatim / server / starlette / server.py
index bed82f70f2f198c3a49a3519c4301a91caa8296b..41ad899c9908769b970455faab3ffd159e8c688f 100644 (file)
@@ -60,7 +60,12 @@ async def on_status(request: Request) -> Response:
     """
     parse_format(request, StatusResult, 'text')
     result = await request.app.state.API.status()
-    return format_response(request, result)
+    response = format_response(request, result)
+
+    if request.state.format == 'text' and result.status:
+        response.status_code = 500
+
+    return response
 
 
 V1_ROUTES = [