check full upload return text
This commit is contained in:
parent
b277849db1
commit
e5849aac4d
@ -260,9 +260,17 @@ impl HTTPSyncClient {
|
|||||||
async fn upload_inner(&self, body: Body) -> Result<()> {
|
async fn upload_inner(&self, body: Body) -> Result<()> {
|
||||||
let data_part = multipart::Part::stream(body);
|
let data_part = multipart::Part::stream(body);
|
||||||
let resp = self.request("upload", data_part, true).await?;
|
let resp = self.request("upload", data_part, true).await?;
|
||||||
resp.error_for_status()?;
|
resp.error_for_status_ref()?;
|
||||||
|
let text = resp.text().await?;
|
||||||
|
if text != "OK" {
|
||||||
|
Err(AnkiError::SyncError {
|
||||||
|
info: text,
|
||||||
|
kind: SyncErrorKind::Other,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) async fn upload<P>(&mut self, col_path: &Path, progress_fn: P) -> Result<()>
|
pub(crate) async fn upload<P>(&mut self, col_path: &Path, progress_fn: P) -> Result<()>
|
||||||
where
|
where
|
||||||
|
Loading…
Reference in New Issue
Block a user