(request: Request<any>)
| 211 | protected isResponse(msg: any): boolean { return !!msg.id; } |
| 212 | |
| 213 | private async processServerRequest(request: Request<any>) { |
| 214 | let result: unknown; |
| 215 | let error: unknown; |
| 216 | try { |
| 217 | result = await this.handleRequest(request.method, request.params); |
| 218 | } catch (e) { |
| 219 | error = e; |
| 220 | } |
| 221 | const resp = { id: request.id, result, error }; |
| 222 | const json = this.messagesWrappedInBrackets |
| 223 | ? "[" + JSON.stringify(resp) + "]\r\n" |
| 224 | : JSON.stringify(resp) + "\r\n"; |
| 225 | this.sendMessage(json); |
| 226 | } |
| 227 | |
| 228 | private async handleResponse(evt: UnknownResponse): Promise<void> { |
| 229 | const handler = this.activeRequests[evt.id]; |
nothing calls this directly
no test coverage detected