Add more error messages in firmware download

This commit is contained in:
Robert Strouse 2023-12-30 18:15:51 -08:00
parent 7a0ff2dffb
commit b86bbdaa4a
2 changed files with 10 additions and 3 deletions

View file

@ -444,6 +444,7 @@ int8_t GitUpdater::downloadFile() {
delay(1);
if(total >= len) {
if(!Update.end()) {
Serial.println("Error downloading update...");
Update.printError(Serial);
}
else {
@ -453,9 +454,15 @@ int8_t GitUpdater::downloadFile() {
}
}
}
Serial.printf("Update %s complete\n", this->currentFile);
free(buff);
if(len < total) {
Serial.println("Error downloading file");
return -42;
}
else
Serial.printf("Update %s complete\n", this->currentFile);
}
else {
// TODO: memory allocation error.