Skip to content

Commit

Permalink
Rename IPCFlaky exception
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuh25 committed Apr 25, 2024
1 parent 6bc5db4 commit 5f6fcdf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions eth_defi/event_reader/fast_json_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@

import logging
from json import JSONDecodeError

from typing import cast

import ujson

from web3 import Web3
from web3.providers import JSONBaseProvider
from web3.types import RPCResponse


logger = logging.getLogger(__name__)


class IPCFlaky(JSONDecodeError):
class PartialHttpResponseException(JSONDecodeError):
"""IPCProvider expects JSONDecodeErrors, not value errors."""


Expand All @@ -30,7 +27,7 @@ def _fast_decode_rpc_response(raw_response: bytes) -> RPCResponse:
# We received partial JSON-RPC response over IPC.
# Signal the underlying stack to keep reading
# See IPCProvider.make_request()
raise IPCFlaky("Partial IPC?", "", 0) from e
raise PartialHttpResponseException("Suspected partial HTTP response", "", 0) from e
return cast(RPCResponse, decoded)


Expand Down

0 comments on commit 5f6fcdf

Please sign in to comment.