]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/server/falcon/server.py
add wsgi entry point for starlette
[nominatim.git] / nominatim / server / falcon / server.py
index 1885330748960de27e6d56f17155c7e4dddf1889..7478ec39c1275b9e51f896e1c753eed0a8b08e16 100644 (file)
@@ -10,7 +10,6 @@ Server implementation using the falcon webserver framework.
 from typing import Optional, Mapping, cast, Any
 from pathlib import Path
 
-import falcon
 from falcon.asgi import App, Request, Response
 
 from nominatim.api import NominatimAPIAsync
@@ -26,9 +25,12 @@ class HTTPNominatimError(Exception):
         self.content_type = content_type
 
 
-async def nominatim_error_handler(req: Request, resp: Response,
+async def nominatim_error_handler(req: Request, resp: Response, #pylint: disable=unused-argument
                                   exception: HTTPNominatimError,
                                   _: Any) -> None:
+    """ Special error handler that passes message and content type as
+        per exception info.
+    """
     resp.status = exception.status
     resp.text = exception.msg
     resp.content_type = exception.content_type