-
Notifications
You must be signed in to change notification settings - Fork 378
docs: add guide about error handling #1149
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
Files not reviewed (1)
- docs/guides/error_handling.mdx: Language not supported
Comments suppressed due to low confidence (2)
docs/guides/code_examples/error_handling/handle_proxy_error.py:29
- [nitpick] Consider using a separator like an underscore (e.g. f'retry_{request.unique_key}') to improve the readability of the unique_key.
new_request = Request.from_url(request.url, unique_key=f'retry{request.unique_key}')
docs/guides/code_examples/error_handling/change_handle_error_status.py:33
- If response.read() returns bytes, consider decoding the response (e.g. using response.read().decode('utf-8')) before passing it to json.loads to avoid potential errors.
data = json.loads(response.read())
Lately, we've been getting a lot of questions about error handling or related issues. Any ideas on how to improve the examples or additional examples are welcome. |
Good idea, thanks! We should add a similar guide to the JS version too I guess, would you be up for that too Max? |
I hardly ever write in JS. I think that the code samples I can produce are hardly worth showing to anyone 😅 |
All right, no worries, someone else can handle that. |
docs/guides/code_examples/error_handling/change_handle_error_status.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Vlada Dusek <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great, thanks 🙂 .
Description