-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[py] Return HTTP response reason when remote connection error occurs #15942
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
[py] Return HTTP response reason when remote connection error occurs #15942
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
This is very useful |
User description
🔗 Related Issues
Fixes #15931
💥 What does this PR do?
This PR updates the
_request
method inRemoteConnection
, so an HTTP response reason is returned when a Remote WebDriver server returns an HTTP error.Previously, if an HTTP response was returned with a status code >= 500 that had no response body, it would return a blank
value
. With this update, any HTTP error (response code >= 400) will return the response reason as thevalue
. This will lead to more clear exceptions being raised when this occurs (previously it would raise an exception with a blank message).🔄 Types of changes
PR Type
Bug fix
Description
Return HTTP response reason for remote connection errors
Improve error handling for status codes >= 400
Provide clearer exception messages for HTTP errors
Changes walkthrough 📝
remote_connection.py
Improve HTTP error response handling
py/selenium/webdriver/remote/remote_connection.py
399 < statuscode <= 500
tostatuscode >= 400