Skip to content

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

Merged
niheaven merged 2 commits intoScoopInstaller:developfrom
chawyehsu:patch-4
Apr 30, 2024
Merged

fix(scoop-search): Catch error of parsing invalid manifest#5930
niheaven merged 2 commits intoScoopInstaller:developfrom
chawyehsu:patch-4

Conversation

@chawyehsu
Copy link
Copy Markdown
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>
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