kenhuuu commented on code in PR #3507:
URL: https://github.com/apache/tinkerpop/pull/3507#discussion_r3532078869


##########
gremlin-python/src/main/python/gremlin_python/driver/aiohttp/transport.py:
##########
@@ -71,6 +71,17 @@ def _normalize_compression(compression):
     raise TypeError("compression must be a str ('none'|'deflate'), got %s" % 
type(compression).__name__)
 
 
+def _run_read(loop, read_timeout, coro):
+    """Run a response-read coroutine on ``loop``, normalizing aiohttp's read 
timeout
+    (SocketTimeoutError / ServerTimeoutError) into a plain 
``asyncio.TimeoutError`` so a
+    read timeout always surfaces as one deterministic, library-agnostic 
type."""
+    try:
+        return loop.run_until_complete(coro)
+    except aiohttp.ServerTimeoutError as e:
+        raise asyncio.TimeoutError(

Review Comment:
   I'm not sure this is the right decision. The driver is currently 
synchronous, so have users "except/catch" or see an asyncio error might be a 
bit odd. That said, returning aiohttp internals also probably not great. So 
maybe we just make our own TimeoutError?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to