MCPcopy Create free account
hub / github.com/microsoft/vscode-languageserver-node / handleInvalidMessage

Function handleInvalidMessage

jsonrpc/src/main.ts:695–710  ·  view source on GitHub ↗
(message: Message)

Source from the content-addressed store, hash-verified

693 }
694
695 function handleInvalidMessage(message: Message) {
696 if (!message) {
697 logger.error('Received empty message.');
698 return;
699 }
700 logger.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(message, null, 4)}`);
701 // Test whether we find an id to reject the promise
702 let responseMessage: ResponseMessage = message as ResponseMessage;
703 if (Is.string(responseMessage.id) || Is.number(responseMessage.id)) {
704 let key = String(responseMessage.id);
705 let responseHandler = responsePromises[key];
706 if (responseHandler) {
707 responseHandler.reject(new Error('The received response has neither a result nor an error property.'));
708 }
709 }
710 }
711
712 function traceSendingRequest(message: RequestMessage): void {
713 if (trace === Trace.Off || !tracer) {

Callers 1

processMessageQueueFunction · 0.85

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected