-
Notifications
You must be signed in to change notification settings - Fork 21
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
Language Server should gracefully fail if Puppet gem cannot be found #118
Comments
glennsarti
added a commit
to glennsarti/puppet-editor-services
that referenced
this issue
May 27, 2019
Previously the language server would crash/terminate early if a critical gem like puppet was unavailable. This can happen when the ruby environment is not from the Puppet Agent or PDK. This commit changes the behaviour of the Language Server to still execute but it a completely disable fashion: * Detects a failed gem load for critical gems and sets PuppetLanguageServer.active? is to false * When the Language Server is not active, a different Message Router is used which effectively warns the user that the server failed to start and that all functions are disabled. The server responds to the client with no capabilities and the custom getVersion request, is responded to with unknown data
glennsarti
added a commit
to glennsarti/puppet-editor-services
that referenced
this issue
May 27, 2019
Previously the language server would crash/terminate early if a critical gem like puppet was unavailable. This can happen when the ruby environment is not from the Puppet Agent or PDK. This commit changes the behaviour of the Language Server to still execute but it a completely disable fashion: * Detects a failed gem load for critical gems and sets PuppetLanguageServer.active? is to false * When the Language Server is not active, a different Message Router is used which effectively warns the user that the server failed to start and that all functions are disabled. The server responds to the client with no capabilities and the custom getVersion request, is responded to with unknown data No automated tests were added as this is an edge case. Manual testing was performed by changing the call `require 'puppet'` to `require 'puppetxxxxx'` which is enough to trigger a failure.
jpogran
pushed a commit
that referenced
this issue
May 28, 2019
(GH-118) Fail gracefully when critical gems cannot load
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is possible to start the language server using the system ruby, but it will not contain the puppet gem.
This can happen on Linux/MacOS when the puppet agent is not installed.
Perhaps the language server should gracefully close if it cannot find required dependent gems and not spit out errors like:
The text was updated successfully, but these errors were encountered: