]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/server/sanic/server.py
fix error message for non-existing database
[nominatim.git] / nominatim / server / sanic / server.py
index d00676b915eb65737767e66f0fe5d9da5ba77c87..74841f3f798298a68a78339a3ac24cb09b64ef90 100644 (file)
@@ -61,7 +61,13 @@ async def extract_format(request: sanic.Request) -> Optional[sanic.HTTPResponse]
 async def status(request: sanic.Request) -> sanic.HTTPResponse:
     """ Implementation of status endpoint.
     """
-    return api_response(request,await request.app.ctx.api.status())
+    result = await request.app.ctx.api.status()
+    response = api_response(request, result)
+
+    if request.ctx.format == 'text' and result.status:
+        response.status = 500
+
+    return response
 
 
 def get_application(project_dir: Path,