From 5f6fcdf6212cb1a744be35d184c6d0332fe1133c Mon Sep 17 00:00:00 2001 From: Hieu Nguyen Date: Thu, 25 Apr 2024 12:15:23 +0300 Subject: [PATCH] Rename IPCFlaky exception --- eth_defi/event_reader/fast_json_rpc.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/eth_defi/event_reader/fast_json_rpc.py b/eth_defi/event_reader/fast_json_rpc.py index 7e0b636b..377c1a37 100644 --- a/eth_defi/event_reader/fast_json_rpc.py +++ b/eth_defi/event_reader/fast_json_rpc.py @@ -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.""" @@ -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)