Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve error logging in rpc retry #87

Merged
merged 2 commits into from
Apr 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions plaidcloud/rpc/connection/jsonrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import requests
from requests.adapters import HTTPAdapter
from requests_futures.sessions import FuturesSession
import urllib3.request

Check warning on line 11 in plaidcloud/rpc/connection/jsonrpc.py

View workflow job for this annotation

GitHub Actions / PyLint

[PyLint] plaidcloud/rpc/connection/jsonrpc.py#L11

E0401: Unable to import 'urllib3.request' (import-error)
Raw output
plaidcloud/rpc/connection/jsonrpc.py:11:0: E0401: Unable to import 'urllib3.request' (import-error)

Check warning on line 11 in plaidcloud/rpc/connection/jsonrpc.py

View workflow job for this annotation

GitHub Actions / PyLint

[PyLint] plaidcloud/rpc/connection/jsonrpc.py#L11

C0412: Imports from package urllib3 are not grouped (ungrouped-imports)
Raw output
plaidcloud/rpc/connection/jsonrpc.py:11:0: C0412: Imports from package urllib3 are not grouped (ungrouped-imports)
from urllib3.util.retry import Retry
import orjson as json
from packaging import version
Expand Down Expand Up @@ -160,12 +161,12 @@
return True

def increment(self, *args, **kwargs):
print(f'Hit Retry, Request History Looks Like: {self.history}')
if self.history:
print(f'Hit Retry, Request History Looks Like: {self.history}')
print(f'Error Status and Content: {self.history[-1].status}: {self.history[-1].error}')
if not self.allow_transmit:
raise Exception('No more retries, RPC method has been cancelled')
return super(RPCRetry, self).increment(*args, **kwargs)


class SimpleRPC(PlainRPCCommon):
"""Call remote rpc methods with a dot based interface, almost as if they
were simply functions in modules.
Expand Down
Loading