Skip to content

Conversation

danmoseley
Copy link
Member

Description

Fix #9368

Philosophically perhaps this should go in the dotnet CLI which shouldn't dump this stack.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • [] Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@Copilot Copilot AI review requested due to automatic review settings May 16, 2025 21:49
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 16, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses #9368 by improving error handling for JSON parsing in the DotNetCliRunner. Key changes include wrapping the JSON parse call in a try...catch block, logging a clear error message when parsing fails, and returning an appropriate error code.

@danmoseley danmoseley requested a review from mitchdenny May 16, 2025 21:50
@danmoseley danmoseley added area-cli and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels May 16, 2025
@danmoseley danmoseley requested a review from Copilot May 16, 2025 21:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses issue #9368 by adding error handling around JSON parsing of package search results to prevent stack traces from being dumped.

  • Wraps JSON parsing logic in a try-catch block
  • Logs a concise error message and returns a specific exit code on JSON errors

@danmoseley danmoseley merged commit ef5ab9a into dotnet:main May 16, 2025
254 checks passed
@danmoseley danmoseley deleted the fixjson branch May 16, 2025 22:50
@github-actions github-actions bot locked and limited conversation to collaborators Jun 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLI searching for templates failed with JsonReaderException: 'W' is an invalid start of a value. and stack
3 participants