use vendored hyper for panic fix

This commit is contained in:
Damien Elmes 2020-06-11 13:26:14 +10:00
parent a8de5ad98a
commit 10a1d06dce
3 changed files with 9 additions and 0 deletions

View File

@ -71,3 +71,6 @@ fluent-syntax = "0.9.2"
[dev-dependencies] [dev-dependencies]
env_logger = "0.7.1" env_logger = "0.7.1"
[patch.crates-io]
hyper = { git = "https://github.com/ankitects/hyper.git", branch = "gai-cancel-panic" }

View File

@ -243,6 +243,9 @@ fn error_for_status_code(info: String, code: StatusCode) -> AnkiError {
} }
fn guess_reqwest_error(info: String) -> 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") { let kind = if info.contains("unreachable") || info.contains("dns") {
NetworkErrorKind::Offline NetworkErrorKind::Offline
} else { } else {

View File

@ -18,3 +18,6 @@ features = ["extension-module"]
[lib] [lib]
name = "ankirspy" name = "ankirspy"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[patch.crates-io]
hyper = { git = "https://github.com/ankitects/hyper.git", branch = "gai-cancel-panic" }