mirror of
https://github.com/FlipsideCrypto/web3.py.git
synced 2026-02-06 19:06:52 +00:00
26 lines
808 B
Python
26 lines
808 B
Python
import json
|
|
|
|
|
|
class InvalidNumberOfParamsException(Exception):
|
|
def __init__(self):
|
|
Exception.__init__(self, "Invalid number of input parameters")
|
|
|
|
|
|
class InvalidConnectionException(Exception):
|
|
def __init__(self, host="?"):
|
|
Exception.__init__(self, "CONNECTION ERROR: Couldn't connect to node " + host + ".")
|
|
|
|
|
|
class InvalidProviderException(Exception):
|
|
def __init__(self):
|
|
Exception.__init__(self, "Provider not set or invalid")
|
|
|
|
|
|
class InvalidResponseException(Exception):
|
|
def __init__(self, result):
|
|
if isinstance(result, dict) and result["error"] and result["error"]["message"]:
|
|
message = result["error"]["message"]
|
|
else:
|
|
message = "Invalid JSON RPC response: " + json.dumps(result)
|
|
Exception.__init__(self, message)
|