Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Sources/PostgresNIO/New/PostgresChannelHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,13 @@ final class PostgresChannelHandler: ChannelDuplexHandler {
_ cleanup: ConnectionStateMachine.ConnectionAction.CleanUpContext,
context: ChannelHandlerContext
) {
self.logger.debug("Cleaning up and closing connection.", metadata: [.error: "\(cleanup.error)"])

// Don't log a misleading error if the client closed the connection.
if cleanup.error.code == .clientClosedConnection {
self.logger.debug("Cleaning up and closing connection.")
} else {
self.logger.debug("Cleaning up and closing connection.", metadata: [.error: "\(cleanup.error)"])
}

// 1. fail all tasks
cleanup.tasks.forEach { task in
task.failWithError(cleanup.error)
Expand Down