mirror of
https://codeberg.org/icewind/tasmota-mqtt-client.git
synced 2026-06-03 18:24:09 +02:00
download error handling
This commit is contained in:
parent
6a31d536bf
commit
12a6ab3e95
2 changed files with 4 additions and 1 deletions
|
|
@ -91,6 +91,9 @@ pub async fn download_config(
|
||||||
"Done" => {
|
"Done" => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
_ if status.starts_with("Error") => {
|
||||||
|
return Err(DownloadError::Unknown(status.into()).into());
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ pub enum DownloadError {
|
||||||
#[error("Invalid file type")]
|
#[error("Invalid file type")]
|
||||||
InvalidFileType,
|
InvalidFileType,
|
||||||
#[error("Received error code: {0}")]
|
#[error("Received error code: {0}")]
|
||||||
Unknown(u32),
|
Unknown(String),
|
||||||
#[error("Mismatched payload length, expected {0} got {1}")]
|
#[error("Mismatched payload length, expected {0} got {1}")]
|
||||||
MismatchedLength(u32, u32),
|
MismatchedLength(u32, u32),
|
||||||
#[error("Received an invalid md5 hash")]
|
#[error("Received an invalid md5 hash")]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue