Skip to content

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

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

Conversation

Mantisus
Copy link
Collaborator

Description

  • add guide about error handling

@Mantisus Mantisus requested a review from Copilot April 10, 2025 20:36
Copy link

@Copilot Copilot AI left a 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())

@Mantisus
Copy link
Collaborator Author

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.

@Mantisus Mantisus self-assigned this Apr 10, 2025
@B4nan
Copy link
Member

B4nan commented Apr 11, 2025

Good idea, thanks!

We should add a similar guide to the JS version too I guess, would you be up for that too Max?

@Mantisus
Copy link
Collaborator Author

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 😅

@B4nan
Copy link
Member

B4nan commented Apr 11, 2025

All right, no worries, someone else can handle that.

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