mirror of
https://github.com/ankitects/anki.git
synced 2026-01-14 06:23:57 -05:00
check full upload return text
This commit is contained in:
parent
73eef285f0
commit
c6e5dc0ef6
1 changed files with 10 additions and 2 deletions
|
|
@ -260,8 +260,16 @@ impl HTTPSyncClient {
|
|||
async fn upload_inner(&self, body: Body) -> Result<()> {
|
||||
let data_part = multipart::Part::stream(body);
|
||||
let resp = self.request("upload", data_part, true).await?;
|
||||
resp.error_for_status()?;
|
||||
Ok(())
|
||||
resp.error_for_status_ref()?;
|
||||
let text = resp.text().await?;
|
||||
if text != "OK" {
|
||||
Err(AnkiError::SyncError {
|
||||
info: text,
|
||||
kind: SyncErrorKind::Other,
|
||||
})
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn upload<P>(&mut self, col_path: &Path, progress_fn: P) -> Result<()>
|
||||
|
|
|
|||
Loading…
Reference in a new issue