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

fix(scoop-search): Catch error of parsing invalid manifest #5930

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

chawyehsu
Copy link
Member

@chawyehsu chawyehsu commented Apr 30, 2024

Description

Catch error of parsing invalid manifest

before:

MethodInvocationException: <path_to_scoop>\apps\scoop\current\libexec\scoop-search.ps1:64
Line |
  64 |          $json = [System.Text.Json.JsonDocument]::Parse([System.IO.Fil|          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "Parse" with "1" argument(s): "The input does not contain any JSON tokens.
     | Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 |
     | BytePositionInLine: 0."

after:

No error thrown, also the invalid manifest can be troubleshooted when turning on debug mode.

Motivation and Context

Closes #XXXX

Relates to #XXXX

How Has This Been Tested?

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
@niheaven niheaven merged commit 23d55ce into ScoopInstaller:develop Apr 30, 2024
2 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