You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Trace logs should clearly indicate an error has happened #1604
The trace message makes no indication that an error was sent back and I could not figure out why the client/registerCapability was not even being hit. Since the messages were getting logged I knew they were not totally "lost" so I added breakpoints to the vscode-jsonrpc code and realized that VS Code did not like how I had formatted my client/registerCapability request.
returnreplyError(newResponseError<void>(ErrorCodes.InvalidParams,`Request ${requestMessage.method} defines parameters by name but received parameters by position`),requestMessage.method,startTime);
tracer.log(`Sending response '${method} - (${message.id})'. Processing request took ${Date.now()-startTime}ms`,data);
}else{
logLSPMessage('send-response',message);
}
}
It seems to me that we should check for more than just message.error && message.error.data. If message.error.code and/or message.error.message is available then we should log those in the trace too.
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "Request client/registerCapability defines parameters by name but received parameters by position"
}
}
Activity
Include error code and message in the 'Sending response' trace log (#…