Skip to content

Commit eb5df92

Browse files
committed
Use our own errors
1 parent ccc567e commit eb5df92

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

bittensor/core/errors.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,22 @@
1919

2020
from typing import Optional, TYPE_CHECKING
2121

22-
from substrateinterface.exceptions import SubstrateRequestException
23-
2422
if TYPE_CHECKING:
2523
from bittensor.core.synapse import Synapse
2624

2725

26+
class SubstrateRequestException(Exception):
27+
pass
28+
29+
30+
class BlockNotFound(Exception):
31+
pass
32+
33+
34+
class ExtrinsicNotFound(Exception):
35+
pass
36+
37+
2838
class ChainError(SubstrateRequestException):
2939
"""Base error for any chain related errors."""
3040

bittensor/utils/substrate_interface.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
from scalecodec.base import ScaleBytes, ScaleType, RuntimeConfigurationObject
2323
from scalecodec.type_registry import load_type_registry_preset
2424
from scalecodec.types import GenericCall, GenericRuntimeCallDefinition
25-
from substrateinterface.exceptions import (
26-
SubstrateRequestException,
27-
ExtrinsicNotFound,
28-
BlockNotFound,
29-
)
3025
from substrateinterface.storage import StorageKey
3126
from websockets.asyncio.client import connect
3227
from websockets.exceptions import ConnectionClosed
3328

29+
from bittensor.core.errors import (
30+
SubstrateRequestException,
31+
ExtrinsicNotFound,
32+
BlockNotFound,
33+
)
3434
from bittensor.utils import hex_to_bytes
3535
from bittensor.utils.btlogging import logging
3636

0 commit comments

Comments
 (0)