Skip to content

Commit 223f989

Browse files
committed
LanguageServerProtocolJSONRPC: avoid failing cast on Windows
This error code is poorly mapped on Windows and results in a runtime failure. Avoid the cast to improve stability.
1 parent 635d0cb commit 223f989

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Sources/LanguageServerProtocolJSONRPC/JSONRPCConnection.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ public final class JSONRPCConnection {
132132

133133
receiveIO.read(offset: 0, length: Int.max, queue: queue) { done, data, errorCode in
134134
guard errorCode == 0 else {
135+
#if !os(Windows)
135136
if errorCode != POSIXError.ECANCELED.rawValue {
136137
log("IO error reading \(errorCode)", level: .error)
137138
}
139+
#endif
138140
if done { self._close() }
139141
return
140142
}

0 commit comments

Comments
 (0)