Skip to content

Commit 475e534

Browse files
committed
flasher: update error handling when download from server fails
1 parent 2a40803 commit 475e534

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

flasher.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,20 +299,24 @@ void Flasher::LoopHandler() {
299299

300300
if (socket_client_->DownloadFile(board_info_, client_security_data_, selected_file_version_, server_security_data_, file_content_)) {
301301
if (file_content_.isEmpty()) {
302-
emit ShowStatusMsg("Download error");
302+
emit ClearProgress();
303+
emit ShowStatusMsg("Download file error");
303304
SetState(FlasherStates::kIdle);
304305
} else {
305306

306-
packet_size_ = kSecurePacketSize;
307-
emit ShowTextInBrowser("Secure connection detected!");
308-
309307
if (client_security_data_.empty() || server_security_data_.empty()) {
310308
SetState(FlasherStates::kCheckSignature);
311309
} else {
310+
packet_size_ = kSecurePacketSize;
312311
SetState(FlasherStates::kSendServerSecurityData);
312+
emit ShowTextInBrowser("Secure connection detected!");
313313
}
314314
}
315+
315316
} else {
317+
emit ClearProgress();
318+
emit ShowStatusMsg("Download server error");
319+
316320
SetState(FlasherStates::kIdle);
317321
}
318322

0 commit comments

Comments
 (0)