Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion async_substrate_interface/async_substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
SubstrateRequestException,
ExtrinsicNotFound,
BlockNotFound,
MaxRetriesExceeded,
)
from async_substrate_interface.types import (
ScaleObj,
Expand Down Expand Up @@ -1914,7 +1915,7 @@ async def _make_rpc_request(
logger.warning(
f"Timed out waiting for RPC requests {attempt} times. Exiting."
)
raise SubstrateRequestException("Max retries reached.")
raise MaxRetriesExceeded("Max retries reached.")
else:
self.ws.last_received = time.time()
await self.ws.connect(force=True)
Expand Down
4 changes: 4 additions & 0 deletions async_substrate_interface/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class SubstrateRequestException(Exception):
pass


class MaxRetriesExceeded(SubstrateRequestException):
pass


class StorageFunctionNotFound(ValueError):
pass

Expand Down
3 changes: 2 additions & 1 deletion async_substrate_interface/sync_substrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ExtrinsicNotFound,
SubstrateRequestException,
BlockNotFound,
MaxRetriesExceeded,
)
from async_substrate_interface.types import (
SubstrateMixin,
Expand Down Expand Up @@ -1615,7 +1616,7 @@ def _make_rpc_request(
logger.warning(
f"Timed out waiting for RPC requests {attempt} times. Exiting."
)
raise SubstrateRequestException("Max retries reached.")
raise MaxRetriesExceeded("Max retries reached.")
else:
return self._make_rpc_request(
payloads,
Expand Down
Loading