-
Notifications
You must be signed in to change notification settings - Fork 18
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
Unexpected dead of HTTP request for completion endpoint #189
Comments
I supposed the issue is on all endpoint. It's just because the error returned is nil and the struct is nil too. |
Ouch, nice find! Returning More concretely, nil pointer checks are missing in two places: Line 143 in 4e7ee5f
Line 207 in 4e7ee5f
However, for this particular example request, fixing #185 would probably have prevented the crash as well, since the invalid position should cause a |
if there is no result, it would be nice to return an empty struct instead don't you think ? We would avoid this kind of situation at least |
It wouldn't hurt to do that and is the nicer solution. |
Fixes #189. This fixes some unchecked pointer accesses in the cache package. Independently of how errors are handled, these checks should be in place. Proper error handling as discussed in #189 and #181 can happen separately. Signed-off-by: Tobias Guggenmos <[email protected]>
On second thought, that's not always what we want. For example in the case of a signature request with a cursor outside a function call, returning a non-nil value would suggest, the language server actually computed a signature. |
Using the following request will killed the HTTP request on the server side:
curl -XPOST http://localhost:8080/completion -d '{"expr":"sum ", "limit": 100, "positionChar": 4, "positionLine": 0}' curl: (52) Empty reply from server
On server side
The text was updated successfully, but these errors were encountered: