Skip to content

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