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

added error catching code #81

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

added error catching code #81

wants to merge 1 commit into from

Conversation

aniemerg
Copy link
Member

Not sure if we should merge, just wanted to share this code.

@aniemerg aniemerg requested a review from sgzsh269 May 12, 2023 17:28
# Check if status code is 400
if response.status_code == 400:
# Write the request data to a file with the current time in the filename
filename = f"error_{time.strftime('%Y%m%d_%H%M%S')}.txt"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function is called for every Web3 request that is routed/forwarded, it seems like this logic would create a new error log file for every 400 that is encountered
Ideally, you would want to setup the error log file at the start of the session and re-use that to capture all the errors in a single file, similar to how it is being done for the existing log file
https://github.com/yieldprotocol/chatweb3-backend/blob/dev/discovery/playwright_browser.py#L208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants