diff --git a/rslib/Cargo.toml b/rslib/Cargo.toml index 0d7b7a229..6e94bf8ca 100644 --- a/rslib/Cargo.toml +++ b/rslib/Cargo.toml @@ -71,3 +71,6 @@ fluent-syntax = "0.9.2" [dev-dependencies] env_logger = "0.7.1" +[patch.crates-io] +hyper = { git = "https://github.com/ankitects/hyper.git", branch = "gai-cancel-panic" } + diff --git a/rslib/src/err.rs b/rslib/src/err.rs index 5e07264ab..796aa48e3 100644 --- a/rslib/src/err.rs +++ b/rslib/src/err.rs @@ -243,6 +243,9 @@ fn error_for_status_code(info: String, code: StatusCode) -> AnkiError { } fn guess_reqwest_error(info: String) -> AnkiError { + if info.contains("dns error: cancelled") { + return AnkiError::Interrupted; + } let kind = if info.contains("unreachable") || info.contains("dns") { NetworkErrorKind::Offline } else { diff --git a/rspy/Cargo.toml b/rspy/Cargo.toml index 6de18f71a..e5a591c6b 100644 --- a/rspy/Cargo.toml +++ b/rspy/Cargo.toml @@ -18,3 +18,6 @@ features = ["extension-module"] [lib] name = "ankirspy" crate-type = ["cdylib"] + +[patch.crates-io] +hyper = { git = "https://github.com/ankitects/hyper.git", branch = "gai-cancel-panic" }