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

Fixes JSON::ParserError: unexpected token issue #10381

Merged

Conversation

sachin-sandhu
Copy link
Contributor

@sachin-sandhu sachin-sandhu commented Aug 7, 2024

What are you trying to accomplish?

Preface: Related with JSON::ParserError issues.

Issue: Private registry usually returns 200 code in case of successful response. The response contains package information as a JSON object. But it was observed that some private registries return 200 code with an HTML markup (usually for login). :dependabot: throws a JSON::ParserError in case of invalid JSON object.

Fix: Identify if the response body being returned is valid JSON and raise proper exception in case invalid JSON.


+---------------------------------------------------------+
|              Dependencies failed to update              |
+------------------------+--------------------------------+
| jszip                  | dependency_file_not_resolvable |
+------------------------+--------------------------------+

Anything you want to highlight for special attention from reviewers?

How will you know you've accomplished your goal?

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@sachin-sandhu sachin-sandhu self-assigned this Aug 7, 2024
@sachin-sandhu sachin-sandhu changed the title Adds exception handler for JSON parsing issue Fixes JSON::ParserError: unexpected token issue Aug 7, 2024
@sachin-sandhu sachin-sandhu marked this pull request as ready for review August 7, 2024 03:46
@sachin-sandhu sachin-sandhu requested a review from a team as a code owner August 7, 2024 03:46
@sachin-sandhu sachin-sandhu merged commit 1cdce62 into main Aug 7, 2024
86 checks passed
@sachin-sandhu sachin-sandhu deleted the ssandhu/jsonparsererror-unexpected-token-at-doc-html branch August 7, 2024 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants