Skip to content

Commit eb1c5df

Browse files
authored
Merge pull request swiftlang#40 from abdullahselek/master
Add logs on JSONRPCConnection.
2 parents a9f4e09 + fcc91d6 commit eb1c5df

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Sources/LanguageServerProtocolJSONRPC/JSONRPCConnection.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ public final class JSONRPCConection {
140140
// Setup callback for response type.
141141
decoder.userInfo[.responseTypeCallbackKey] = { id in
142142
guard let outstanding = self.outstandingRequests[id] else {
143-
// Unknown request!
144-
// FIXME: Log
143+
log("Unknown request for \(id)", level: .error)
145144
return nil
146145
}
147146
return outstanding.responseType
@@ -207,15 +206,13 @@ public final class JSONRPCConection {
207206
request._handle(receiveHandler!, id: id, connection: self)
208207
case .response(let response, id: let id):
209208
guard let outstanding = outstandingRequests.removeValue(forKey: id) else {
210-
// Unknown request!
211-
// FIXME: Log
209+
log("Unknown request for \(id)", level: .error)
212210
return
213211
}
214212
outstanding.replyHandler(.success(response))
215213
case .errorResponse(let error, id: let id):
216214
guard let outstanding = outstandingRequests.removeValue(forKey: id) else {
217-
// Unknown request!
218-
// FIXME: Log
215+
log("Unknown request for \(id)", level: .error)
219216
return
220217
}
221218
outstanding.replyHandler(.failure(error))

0 commit comments

Comments
 (0)