fn classify_connect_error(
source: Error,
profile: &Profile,
mode: SslMode,
) -> ConnectionErrorExpand description
Classify a tokio_postgres::Error surfaced from Config::connect(...)
into the most specific ConnectionError variant.
Rules:
- rustls error found in the source chain +
modeisverify-*→ConnectionError::TlsVerification(withhostname_suffixif the certificate does not match the host name or IP). modeisrequire/verify-*and the error message indicates the server refused TLS →ConnectionError::TlsRequiredNotSupported.- Otherwise →
ConnectionError::Connect.