Check if a miette error represents a benign connection close. TLS handshake EOF, missing `close_notify`, connection resets, and broken pipes are all normal lifecycle events for proxied connections — not worth a WARN that interrupts the user's terminal.
(err: &miette::Report)
| 4353 | /// pipes are all normal lifecycle events for proxied connections — not worth |
| 4354 | /// a WARN that interrupts the user's terminal. |
| 4355 | fn is_benign_relay_error(err: &miette::Report) -> bool { |
| 4356 | const BENIGN: &[&str] = &[ |
| 4357 | "close_notify", |
| 4358 | "tls handshake eof", |
| 4359 | "connection reset", |
| 4360 | "broken pipe", |
| 4361 | "unexpected eof", |
| 4362 | ]; |
| 4363 | let msg = err.to_string().to_ascii_lowercase(); |
| 4364 | BENIGN.iter().any(|pat| msg.contains(pat)) |
| 4365 | } |
| 4366 | |
| 4367 | #[cfg(test)] |
| 4368 | #[allow( |
no outgoing calls
no test coverage detected