MCPcopy Create free account
hub / github.com/AI45Lab/Code / transient_error_classification

Function transient_error_classification

core/src/retry.rs:226–237  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

224
225 #[test]
226 fn transient_error_classification() {
227 let t = |s: &str| is_transient_error(&anyhow::anyhow!("{s}"));
228 // Transient network errors → retry.
229 assert!(t("error sending request for url: operation timed out"));
230 assert!(t("connection reset by peer"));
231 assert!(t("LLM error: connection closed before message completed"));
232 assert!(t("tls handshake eof"));
233 // Real application errors → do NOT retry.
234 assert!(!t("invalid api key"));
235 assert!(!t("model not found"));
236 assert!(!t("context length exceeded"));
237 }
238
239 // ========================================================================
240 // RetryConfig unit tests

Callers

nothing calls this directly

Calls 1

is_transient_errorFunction · 0.85

Tested by

no test coverage detected