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" => {
|
||||
break;
|
||||
}
|
||||
_ if status.starts_with("Error") => {
|
||||
return Err(DownloadError::Unknown(status.into()).into());
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ pub enum DownloadError {
|
|||
#[error("Invalid file type")]
|
||||
InvalidFileType,
|
||||
#[error("Received error code: {0}")]
|
||||
Unknown(u32),
|
||||
Unknown(String),
|
||||
#[error("Mismatched payload length, expected {0} got {1}")]
|
||||
MismatchedLength(u32, u32),
|
||||
#[error("Received an invalid md5 hash")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue