-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: explicit check for initializationOptions and add optional chaining #310
Conversation
|
||
return initializeResult | ||
} catch (error) { | ||
if (!params.initializationOptions?.aws) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this field optional in protocol? Check comments in the previous PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, updated PR.
|
||
return initializeResult | ||
} catch (error) { | ||
this.lspConnection.console.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mitigation change added in this PR is not mutually exclusive with the observability change that has now been removed. Why can't we keep the try/catch handling in place? This way if an unexpected error happens in the future, we will have more information at our disposal to help investigate the situation.
Problem
Check related PRs #306 and #307
Prevent errors due to aws object being undefined and improve error handling in initialize method
Solution
aws
object is not set.License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.