Skip to content

Commit

Permalink
error logging for enter_isp_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
carlossless committed Apr 28, 2024
1 parent c3033d4 commit 0c7ab78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/isp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ impl ISPDevice {
let device = api.open_path(request_device_info.path()).unwrap();

info!("Found regular device. Entering ISP mode...");
Self::enter_isp_mode(&device)?;
if let Err(err) = Self::enter_isp_mode(&device) {
debug!("Error: {:}", err);
return Err(err);
}

info!("Waiting for ISP device...");
thread::sleep(time::Duration::from_secs(2));
Expand Down Expand Up @@ -472,7 +475,7 @@ impl ISPDevice {
let cmd: [u8; COMMAND_LENGTH] = [REPORT_ID_CMD, CMD_REBOOT, 0, 0, 0, 0];
if let Err(err) = self.request_device.send_feature_report(&cmd) {
// only log failures
debug!("Reboot error: {:}", err);
debug!("Error: {:}", err);
}
thread::sleep(time::Duration::from_millis(2000));
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub enum CLIError {
fn main() -> ExitCode {
match err_main() {
Ok(_) => ExitCode::SUCCESS,
Err(e) => {
error!("{}", e.to_string());
Err(err) => {
error!("{:}", err);
ExitCode::FAILURE
}
}
Expand Down

0 comments on commit 0c7ab78

Please sign in to comment.