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

Log invalid JSON environment #2000

Merged
merged 1 commit into from
May 2, 2024
Merged

Conversation

vinistock
Copy link
Member

Motivation

When something goes wrong with a version manager and they produce an invalid environment JSON, it's hard to debug or understand what's going on. We should log what string we tried to parse so that we can more easily diagnose issues.

Implementation

Created a parseWithErrorHandling helper in the VersionManager parent class, which tries to parse and logs the error if that fails. Then started using it in all version managers.

Automated Tests

Added a test for rbenv only because the behaviour is the same on all other managers.

@vinistock vinistock added enhancement New feature or request vscode This pull request should be included in the VS Code extension's release notes labels May 1, 2024
@vinistock vinistock self-assigned this May 1, 2024
@vinistock vinistock requested a review from a team as a code owner May 1, 2024 20:45
@vinistock vinistock requested review from andyw8 and st0012 May 1, 2024 20:45
@vinistock vinistock merged commit 1475a6c into main May 2, 2024
41 checks passed
@vinistock vinistock deleted the vs/output_invalid_json_environment branch May 2, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants