Errors¶
The hand-written exception classes. The per-code transaction errors are listed, with their codes, in Errors.
errors ¶
Exceptions raised by pyogmios.
Every exception is an :class:OgmiosError. Errors returned by the server are :class:ResponseError
subclasses chosen by the JSON-RPC error code, and carry the server's code, message and data,
plus details: the data parsed into the method's error model from :mod:pyogmios.types, when it
matches one.
::
OgmiosError
├── OgmiosConnectionError (also a builtin ConnectionError)
├── OgmiosTimeoutError (also a builtin TimeoutError)
├── ServerVersionError
├── StatefulOverHttpError
└── ResponseError
├── JsonRpcError -32700 to -32600
│ ├── ParseError -32700
│ ├── InvalidRequestError -32600
│ ├── MethodNotFoundError -32601
│ ├── InvalidParamsError -32602
│ │ └── TransactionDeserialisationError (submit/evaluate)
│ └── InternalError -32603
├── ChainSyncError 1000s
│ ├── IntersectionNotFoundError 1000
│ └── IntersectionInterleavedError 1001
├── LedgerStateQueryError 2000s
│ ├── AcquireLedgerStateError 2000
│ ├── EraMismatchError 2001
│ ├── UnavailableInCurrentEraError 2002
│ ├── AcquiredExpiredError 2003
│ └── InvalidGenesisError 2004
├── TransactionError 3000s
│ ├── EvaluateTransactionError (evaluateTransaction)
│ │ └── one class per failure: IncompatibleEraError (3000) ... ScriptExecutionFailureError (3010)
│ └── SubmitTransactionError (submitTransaction)
│ └── one class per ledger rejection: SubmitEraMismatchError (3005),
│ InvalidSignatoriesError (3100) ... StakePoolVRFKeyAlreadyRegisteredError (3170)
└── MempoolError 4000s
└── MustAcquireMempoolFirstError 4000
OgmiosError ¶
Bases: Exception
Base class of every pyogmios exception.
OgmiosConnectionError ¶
Bases: OgmiosError, ConnectionError
The client could not connect to Ogmios, or the connection was lost.
OgmiosTimeoutError ¶
Bases: OgmiosError, TimeoutError
Ogmios did not answer in time.
ServerVersionError ¶
Bases: OgmiosError
The server runs an Ogmios version this client does not support.
StatefulOverHttpError ¶
Bases: OgmiosError
A stateful method was called over HTTP.
Chain sync, mempool monitoring and acquiring a ledger state keep state on the connection. Over
HTTP every request is a new session, so the server's answers would be meaningless: use a
ws:// or wss:// URL.
ResponseError ¶
JsonRpcError ¶
JsonRpcError(
code: int,
message: str,
data: Any = None,
*,
method: str | None = None,
details: Any = None
)
Bases: ResponseError
A JSON-RPC protocol error: the request was malformed, unknown or had invalid params.
ParseError ¶
InvalidRequestError ¶
MethodNotFoundError ¶
InvalidParamsError ¶
InternalError ¶
ChainSyncError ¶
IntersectionNotFoundError ¶
IntersectionInterleavedError ¶
LedgerStateQueryError ¶
AcquireLedgerStateError ¶
EraMismatchError ¶
UnavailableInCurrentEraError ¶
AcquiredExpiredError ¶
InvalidGenesisError ¶
TransactionError ¶
EvaluateTransactionError ¶
SubmitTransactionError ¶
TransactionDeserialisationError ¶
TransactionDeserialisationError(
code: int,
message: str,
data: Any = None,
*,
method: str | None = None,
details: Any = None
)
Bases: InvalidParamsError, TransactionError
The transaction could not be decoded in any era. data lists the decoder errors.
MempoolError ¶
MustAcquireMempoolFirstError ¶
error_class ¶
error_class(
code: int, method: str | None
) -> type[ResponseError]
The exception class for a JSON-RPC error code returned by method.