MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / is_benign_relay_error

Function is_benign_relay_error

crates/openshell-supervisor-network/src/proxy.rs:4355–4365  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

4353/// pipes are all normal lifecycle events for proxied connections — not worth
4354/// a WARN that interrupts the user's terminal.
4355fn 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(

Callers 1

handle_tcp_connectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected