In Python <= 3.10 this is not yet the same as TimeoutError.
Fixes #3303.
from typing import Optional, Mapping, cast, Any, List
from pathlib import Path
import datetime as dt
from typing import Optional, Mapping, cast, Any, List
from pathlib import Path
import datetime as dt
from falcon.asgi import App, Request, Response
from falcon.asgi import App, Request, Response
middleware=middleware)
app.add_error_handler(HTTPNominatimError, nominatim_error_handler)
app.add_error_handler(TimeoutError, timeout_error_handler)
middleware=middleware)
app.add_error_handler(HTTPNominatimError, nominatim_error_handler)
app.add_error_handler(TimeoutError, timeout_error_handler)
+ # different from TimeoutError in Python <= 3.10
+ app.add_error_handler(asyncio.TimeoutError, timeout_error_handler)
legacy_urls = api.config.get_bool('SERVE_LEGACY_URLS')
for name, func in api_impl.ROUTES:
legacy_urls = api.config.get_bool('SERVE_LEGACY_URLS')
for name, func in api_impl.ROUTES:
from typing import Any, Optional, Mapping, Callable, cast, Coroutine, Dict, Awaitable
from pathlib import Path
import datetime as dt
from typing import Any, Optional, Mapping, Callable, cast, Coroutine, Dict, Awaitable
from pathlib import Path
import datetime as dt
from starlette.applications import Starlette
from starlette.routing import Route
from starlette.applications import Starlette
from starlette.routing import Route
middleware.append(Middleware(FileLoggingMiddleware, file_name=log_file))
exceptions: Dict[Any, Callable[[Request, Exception], Awaitable[Response]]] = {
middleware.append(Middleware(FileLoggingMiddleware, file_name=log_file))
exceptions: Dict[Any, Callable[[Request, Exception], Awaitable[Response]]] = {
- TimeoutError: timeout_error
+ TimeoutError: timeout_error,
+ asyncio.TimeoutError: timeout_error
}
async def _shutdown() -> None:
}
async def _shutdown() -> None: