2121 unstructure ,
2222)
2323
24- from ._client_rpc import BadResponseFormat , ClientSessionRPC , ProviderError , RemoteError
24+ from ._client_rpc import BadResponseFormat , ClientSessionRPC , ProviderError
2525from ._contract import (
2626 BaseBoundMethodCall ,
2727 BoundConstructorCall ,
@@ -61,10 +61,10 @@ async def session(self) -> AsyncIterator["ClientSession"]:
6161 # TODO (#58): incorporate cached values from the session back into the client
6262
6363
64- class TransactionFailed (RemoteError ):
64+ class TransactionFailed (Exception ):
6565 """
66- Raised if the transaction was submitted successfully,
67- but the final receipt indicates a failure .
66+ Raised for invalid transactions that are not contract executions
67+ (e.g. transfers or contract deployments) .
6868 """
6969
7070
@@ -121,7 +121,7 @@ def from_int(cls, val: int) -> "ContractPanicReason":
121121 return cls .UNKNOWN
122122
123123
124- class ContractPanic (RemoteError ):
124+ class ContractPanic (Exception ):
125125 """A panic raised in a contract call."""
126126
127127 Reason = ContractPanicReason
@@ -138,7 +138,7 @@ def __init__(self, reason: ContractPanicReason):
138138 self .reason = reason
139139
140140
141- class ContractLegacyError (RemoteError ):
141+ class ContractLegacyError (Exception ):
142142 """A raised Solidity legacy error (from ``require()`` or ``revert()``)."""
143143
144144 message : str
@@ -149,7 +149,7 @@ def __init__(self, message: str):
149149 self .message = message
150150
151151
152- class ContractError (RemoteError ):
152+ class ContractError (Exception ):
153153 """A raised Solidity error (from ``revert SomeError(...)``)."""
154154
155155 error : Error
@@ -186,7 +186,19 @@ def decode_contract_error(
186186
187187
188188class ClientSession :
189- """An open session to the provider."""
189+ """
190+ An open session to the provider.
191+
192+ The methods of this class may raise the following exceptions:
193+ :py:class:`ProviderError`,
194+ :py:class:`ContractLegacyError`,
195+ :py:class:`ContractError`,
196+ :py:class:`ContractPanic`,
197+ :py:class:`TransactionFailed`,
198+ :py:class:`Unreachable`,
199+ :py:class:`BadResponseFormat`,
200+ a provider-specific derived class of :py:class:`ProtocolError`.
201+ """
190202
191203 def __init__ (self , provider_session : ProviderSession ):
192204 self ._provider_session = provider_session
0 commit comments