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.
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 theVersionManager
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.