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

Prevent an exception when err.message is nil #1630

Closed
wants to merge 1 commit into from

Conversation

kdarkhan
Copy link

@kdarkhan kdarkhan commented Dec 28, 2021

When trying to use go-to-definition using telescope's
LSP helper while Sumneko lua-language-server has not completed loading yet,
it returns an error response which does not have message
field.

This error handler tries to log an error by accessing
message field which is a nil. Concatenating nil to a string
throws an exception in Lua. Using tostring() prevents that.

When trying to use go-to-definition using telescope's
LSP helper while Sumneko has not completed loading yet,
it returns an error response which does not have `message`
field. This error handler tries to log an error by accessing
`message` field which is a `nil`. That throws an exception in
Lua, and using `tostring()` prevents that.
@kdarkhan
Copy link
Author

The root cause of my issue was fixed in lua-language-server LuaLS/lua-language-server#879

So this change is not necessary for my use case anymore, but you can still merge it if you find it useful.

@Conni2461
Copy link
Member

Conni2461 commented Jan 5, 2022

Yeah. I think we can skip it if the standard requires it to be not null

Thanks tho :)

@Conni2461 Conni2461 closed this Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants