Skip to content

Commit f20ace8

Browse files
committed
Cleanup logging
1 parent 63062d9 commit f20ace8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Sources/WebSocketClient/WebSocketClient.swift

+1-6
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public final class WebSocketClient {
6161
public func disconnect(reason: String?) {
6262
_state = .disconnecting
6363
transport.cancel(with: .normalClosure, reason: Data(reason?.utf8 ?? "Closing connection".utf8))
64-
6564
}
6665

6766
func receiveMessagesWhileConnected() -> Task<Void, Error> {
@@ -72,11 +71,7 @@ public final class WebSocketClient {
7271
try await self.transport.handle(message)
7372
}
7473
} catch {
75-
logger.error("\(error)")
76-
// FIXME: This should check for the error.
77-
// Also, disconnecting might already cancel the task,
78-
// but not necessarily, as a disconnected socket will
79-
// not send state changes anymore.
74+
logger.error("Error in \(#function): \(error)")
8075
}
8176
logger.trace("WebSocketClient stopped receiving messages")
8277
}

0 commit comments

Comments
 (0)