mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
add some extra help to the json decode error
This commit is contained in:
parent
a109bdaf60
commit
41d37464e6
1 changed files with 11 additions and 1 deletions
|
@ -255,13 +255,23 @@ fn error_for_status_code(info: String, code: StatusCode) -> AnkiError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn guess_reqwest_error(info: String) -> AnkiError {
|
fn guess_reqwest_error(mut info: String) -> AnkiError {
|
||||||
if info.contains("dns error: cancelled") {
|
if info.contains("dns error: cancelled") {
|
||||||
return AnkiError::Interrupted;
|
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 {
|
||||||
|
if info.contains("invalid type") {
|
||||||
|
info = format!(
|
||||||
|
"{} {} {}\n\n{}",
|
||||||
|
"Please force a full sync in the Preferences screen to bring your devices into sync.",
|
||||||
|
"Then, please use the Check Database feature, and sync to your other devices.",
|
||||||
|
"If problems persist, please post on the support forum.",
|
||||||
|
info,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
NetworkErrorKind::Other
|
NetworkErrorKind::Other
|
||||||
};
|
};
|
||||||
AnkiError::NetworkError { info, kind }
|
AnkiError::NetworkError { info, kind }
|
||||||
|
|
Loading…
Reference in a new issue