Skip to content

Commit

Permalink
Use repr for error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cyc60 committed Jul 4, 2023
1 parent 540b7aa commit 7c10d85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions sw_utils/consensus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import logging
from enum import Enum
from typing import Any
Expand Down Expand Up @@ -71,10 +70,7 @@ async def _async_make_get_request(self, endpoint_uri: str) -> dict[str, Any]:
except AiohttpRecoveredErrors as error:
if i == len(self.base_urls) - 1:
raise error
if isinstance(error, asyncio.TimeoutError):
logger.error('%s: asyncio.TimeoutError', url)
else:
logger.error('%s: %s', url, error)
logger.error('%s: %s', url, repr(error))

return {}

Expand Down
6 changes: 1 addition & 5 deletions sw_utils/execution.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import logging
from typing import Any

Expand Down Expand Up @@ -54,10 +53,7 @@ async def make_request(self, method: RPCEndpoint, params: Any) -> RPCResponse:
except AiohttpRecoveredErrors as error:
if i == len(self._providers) - 1:
raise error
if isinstance(error, asyncio.TimeoutError):
logger.error('%s: asyncio.TimeoutError', provider.endpoint_uri)
else:
logger.error('%s: %s', provider.endpoint_uri, error)
logger.error('%s: %s', provider.endpoint_uri, repr(error))

return {}

Expand Down

0 comments on commit 7c10d85

Please sign in to comment.