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

[rust] Throw a descriptive message when error parsing JSON from response #13291

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

bonigarcia
Copy link
Member

Description

This PR enhances the logic related to JSON parsing to use a more descriptive message when error parsing JSON from online response. Example:

./selenium-manager --browser chrome --debug --driver-mirror-url https://googlechromelabs.github.io/chrome-for-testing/BAD
DEBUG   chromedriver not found in PATH
DEBUG   chrome detected at C:\Program Files\Google\Chrome\Application\chrome.exe
DEBUG   Running command: wmic datafile where name='C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe' get Version /value
DEBUG   Output: "\r\r\n\r\r\nVersion=119.0.6045.200\r\r\n\r\r\n\r\r\n\r"
DEBUG   Detected browser: chrome 119.0.6045.200
DEBUG   Discovering versions from https://googlechromelabs.github.io/chrome-for-testing/BAD/known-good-versions-with-downloads.json
WARN    There was an error managing chromedriver (Error parsing JSON from URL https://googlechromelabs.github.io/chrome-for-testing/BAD/known-good-versions-with-downloads.json expected value at line 1 column 1); using driver found in the cache
INFO    Driver path: C:\Users\boni\.cache\selenium\chromedriver\win64\119.0.6045.105\chromedriver.exe
INFO    Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe

Motivation and Context

Improve user experience, as reported in #12675.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov-commenter
Copy link

codecov-commenter commented Dec 12, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (82f7cf7) 57.99% compared to head (4ad829f) 57.99%.

❗ Current head 4ad829f differs from pull request most recent head a736547. Consider uploading reports for the commit a736547 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #13291   +/-   ##
=======================================
  Coverage   57.99%   57.99%           
=======================================
  Files          88       88           
  Lines        5338     5338           
  Branches      224      224           
=======================================
  Hits         3096     3096           
  Misses       2018     2018           
  Partials      224      224           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bonigarcia bonigarcia merged commit dee5bc5 into trunk Dec 12, 2023
33 of 44 checks passed
@bonigarcia bonigarcia deleted the sm_json_error branch December 12, 2023 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants