fix(postgres): log underlying io error on connection failure

This commit is contained in:
Jeff
2026-10-17 11:37:32 +08:00
committed by GitHub
parent 35d06151fa
commit c86abb1ad4
+3 -1
View File
@@ -2997,7 +2997,9 @@ where
// LISTEN/NOTIFY messages are not surfaced anywhere.
Some(Ok(_)) => {}
Some(Err(err)) => {
log::warn!("[postgres] connection driver error: {err}");
// `tokio_postgres::Error`'s `Display` omits the underlying
// I/O error, which is the only clue to why the socket died.
log::warn!("[postgres] connection driver error: {}", error_with_sources_to_string(&err));
break;
}
None => break,