Skip to content

Commit

Permalink
Cleanup error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
danngreen committed Sep 26, 2024
1 parent 975d3c5 commit 79729f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 0 additions & 1 deletion firmware/src/core_intercom/intercore_message.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ struct IntercoreStorageMessage {

RequestReadFlash,
ReadFlashOk,
ReadFlashFailed,

RequestWriteFile,
WriteFileFail,
Expand Down
2 changes: 1 addition & 1 deletion firmware/src/fw_update/firmware_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ IntercoreStorageMessage FirmwareWriter::flashWifi(std::span<uint8_t> buffer,
}

if (not error_during_writes) {
pr_dbg("-> Flashing completed\n");
pr_trace("-> Flashing completed\n");
returnValue = {.message_type = FlashingOk};
} else {
pr_trace("-> Flashing failed\n");
Expand Down
14 changes: 11 additions & 3 deletions firmware/src/fw_update/updater_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,18 @@ FirmwareUpdaterProxy::Status FirmwareUpdaterProxy::process() {
abortWithMessage("Error when comparing checksums");
break;

case FileStorageProxy::WifiExpanderNotConnected:
error_message = "No Wifi Expander: skipping " + manifest.files[current_file_idx].filename;
case FileStorageProxy::WifiExpanderNotConnected: {
error_message = "No Wifi Expander: skipping ";

auto full_path = manifest.files[current_file_idx].filename;
auto slash_pos = full_path.find_first_of("/");
if (slash_pos != std::string::npos)
error_message += full_path.substr(slash_pos + 1);
else
error_message += full_path;

proceedWithNextFile();
break;
} break;

default:
break;
Expand Down

0 comments on commit 79729f7

Please sign in to comment.