+async def timeout_error(request: Request, #pylint: disable=unused-argument
+ _: Exception) -> Response:
+ """ Error handler for query timeouts.
+ """
+ loglib.log().comment('Aborted: Query took too long to process.')
+ logdata = loglib.get_and_disable()
+
+ if logdata:
+ return HTMLResponse(logdata)
+
+ return PlainTextResponse("Query took too long to process.", status_code=503)
+
+