catch timeout error

This commit is contained in:
Damien Elmes 2020-08-21 18:59:00 +10:00
parent cf247baf77
commit 85d99f7348
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,5 @@
network-offline = Please check your internet connection.
network-timeout = Connection timed out. Please try again on a different network.
network-timeout = Connection timed out. Please try again. If you see frequent timeouts, please try a different network connection.
network-proxy-auth = Your proxy requires authentication.
network-other = A network error occurred.

View File

@ -261,6 +261,8 @@ fn guess_reqwest_error(mut info: String) -> AnkiError {
}
let kind = if info.contains("unreachable") || info.contains("dns") {
NetworkErrorKind::Offline
} else if info.contains("timed out") {
NetworkErrorKind::Timeout
} else {
if info.contains("invalid type") {
info = format!(