How to handle cancelled window/showMessageRequest
#1501
Labels
info-needed
Issue requires more information from poster
window/showMessageRequest
#1501
We have sentry enabled on our language-server code and its capturing an unhandled error:
Stack Trace
There are a lot of instances of this unhandled exception (as its almost always being thrown on initialisation) on sentry and we would like to handle and resolve this properly.
I have traced the request to a notification message we send from the server on
connection.onDidChangeConfiguration
(which also gets called on connection initialisation), usingconnection.window.showInformationMessage('some_message')
This is the trace on output console:
I could not see any other trace with a cancelled
window/showMessageRequest
request. This is the onlyshowMessageRequest
that is visible in the VSCode Output channel.I've tried to wrap the request in a
try...catch
but with no success, the error still bubbles up on sentry as unhandled :From stacktrace it seems like coming from the
vscode-jsonrpc
package, which is rejecting the promise with error. I guess some handler needs to be installed on theconnection
object to handle the cancelled request, but could find any resources where something similar is done. Also could not understand from the error message that who is cancelling the request, is it the client or the server.Any help would be greatly appreciated 🙏. Thanks.
Version:
"vscode-languageserver": "7.0.0"
The text was updated successfully, but these errors were encountered: