kevinheavey / solders

A high-performance Python toolkit for Solana, written in Rust
https://kevinheavey.github.io/solders/
Apache License 2.0
205 stars 23 forks source link

Is it possible to catch PanicException #108

Open ruiqic opened 1 week ago

ruiqic commented 1 week ago

Seems like the rust part of the code does not correctly handle some responses. This is using quicknode RPC btw. pyo3_runtime is not a valid module, so the PanicException can't be imported. Even so, using except that attempts to catch all still can't catch the "exception". Any solutions?

Traceback (most recent call last):
  ...
  File "__/script.py", line 500, in __
    first_resp = await ws.recv()
  File "__/lib/python3.10/site-packages/solana/rpc/websocket_api.py", line 115, in recv
    return self._process_rpc_response(cast(str, data))
  File "__/lib/python3.10/site-packages/solana/rpc/websocket_api.py", line 398, in _process_rpc_response
    parsed = parse_websocket_message(raw)
pyo3_runtime.PanicException: unsupported type Some(-32608)