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

⚠️ Goto Error Handler #109

Merged
merged 5 commits into from
Jan 17, 2025
Merged

⚠️ Goto Error Handler #109

merged 5 commits into from
Jan 17, 2025

Conversation

BilalG1
Copy link
Contributor

@BilalG1 BilalG1 commented Jan 17, 2025

Important

Introduce default_error_callback for HTTP error handling in SDK, update version to 0.59.3, and improve test formatting.

  • Error Handling:
    • Introduce default_error_callback in errors.py to handle HTTP errors with GotoError.
    • Replace default_callback with default_error_callback in core.py.
    • Update run() method in core.py to use goto_error_handler with headers.
  • Types:
    • Add headers attribute to ResponseWithStatus in types.py.
  • Tests:
    • Update tests in test_e2e.py and test_stealth.py to use new error handler and improve formatting.
  • Miscellaneous:
    • Bump version to 0.59.3 in pyproject.toml for both core and sdk.

This description was created by Ellipsis for 6bab7e2. It will automatically update as commits are pushed.

@BilalG1 BilalG1 changed the title Goto Error Handler ⚠️ Goto Error Handler Jan 17, 2025
Comment on lines -500 to +498
await callback(url, response.status)
await goto_error_handler(url, response.status, response.headers)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

main change is passing back response headers here so we can check for our custom mitm-error header

Copy link
Contributor

Choose a reason for hiding this comment

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

should we be using this for all go_to calls? Just calling it directly wouldn't use it

@BilalG1 BilalG1 merged commit 8566526 into main Jan 17, 2025
6 checks passed
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