Skip to content

Commit

Permalink
Handle 500 errors as they are valid and may contain more information
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomatedTester committed Jan 14, 2016
1 parent 8c0e81b commit e31d170
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py/selenium/webdriver/remote/remote_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def _request(self, method, url, body=None):
if 300 <= statuscode < 304:
return self._request('GET', resp.getheader('location'))
body = data.decode('utf-8').replace('\x00', '').strip()
if 399 < statuscode < 500:
if 399 < statuscode <= 500:
return {'status': statuscode, 'value': body}
content_type = []
if resp.getheader('Content-Type') is not None:
Expand Down

1 comment on commit e31d170

@liulk
Copy link

@liulk liulk commented on e31d170 Jan 29, 2016

Choose a reason for hiding this comment

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

I noticed that the W3C wire protocol is different than the one on Google Code.

In particular, WebDriver server should not return 500 for "no such element", but 404. Is this part of the series of changes migrating to the W3C protocol? If that's the case, then everything within the 4xx or 5xx range should be interpreted as JSON, so the if clause on lines 476 and 477 should be removed completely.

liulk

Please sign in to comment.