Skip to content

Commit e71808a

Browse files
committed
keep going on error
Just log the error instead of quiting the application.
1 parent 159660d commit e71808a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/deploy.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// SPDX-License-Identifier: MPL-2.0
66

7-
use log::{debug, info};
7+
use log::{debug, error, info};
88
use thiserror::Error;
99
use tokio::process::Command;
1010

@@ -316,7 +316,7 @@ pub async fn confirm_profile(
316316

317317
match ssh_confirm_cmd_handle.status.code() {
318318
Some(0) => (),
319-
a => return Err(ConfirmProfileError::SSHConfirmExit(a)),
319+
a => error!("{}", ConfirmProfileError::SSHConfirmExit(a)),
320320
};
321321

322322
info!("Deployment confirmed.");
@@ -375,7 +375,7 @@ pub async fn deploy_profile(
375375

376376
match ssh_activate_cmd_handle.status.code() {
377377
Some(0) => (),
378-
a => return Err(DeployProfileError::SSHActivateExit(a)),
378+
a => error!("{}", DeployProfileError::SSHActivateExit(a)),
379379
};
380380

381381
if *dry_activate {
@@ -418,7 +418,7 @@ pub async fn deploy_profile(
418418
debug!("Wait command ended");
419419
match x.map_err(DeployProfileError::SSHWait)?.status.code() {
420420
Some(0) => (),
421-
a => return Err(DeployProfileError::SSHWaitExit(a)),
421+
a => error!("{}",DeployProfileError::SSHWaitExit(a)),
422422
};
423423
},
424424
x = recv_activate => {

src/push.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub async fn push_profile(
217217

218218
match show_derivation_output.status.code() {
219219
Some(0) => (),
220-
a => return Err(PushProfileError::ShowDerivationExit(a)),
220+
a => error!("{}", PushProfileError::ShowDerivationExit(a)),
221221
};
222222

223223
let derivation_info: HashMap<&str, serde_json::value::Value> = serde_json::from_str(
@@ -246,15 +246,15 @@ pub async fn push_profile(
246246

247247
match build_cmd_handle.map_err(PushProfileError::Build)?.code() {
248248
Some(0) => (),
249-
a => return Err(PushProfileError::BuildExit(a)),
249+
a => error!("{}", PushProfileError::BuildExit(a)),
250250
};
251251

252252
if !Path::new(format!("{}/deploy-rs-activate", closure).as_str()).exists() {
253-
return Err(PushProfileError::DeployRsActivateDoesntExist);
253+
error!("{}", PushProfileError::DeployRsActivateDoesntExist);
254254
}
255255

256256
if !Path::new(format!("{}/activate-rs", closure).as_str()).exists() {
257-
return Err(PushProfileError::ActivateRsDoesntExist);
257+
error!("{}", PushProfileError::ActivateRsDoesntExist);
258258
}
259259

260260
if let Ok(local_key) = std::env::var("LOCAL_KEY") {
@@ -268,7 +268,7 @@ pub async fn push_profile(
268268

269269
match sign_cmd_handle.status.code() {
270270
Some(0) => (),
271-
a => return Err(PushProfileError::SignExit(a)),
271+
a => error!("{}", PushProfileError::SignExit(a)),
272272
};
273273
}
274274

@@ -284,7 +284,7 @@ pub async fn push_profile(
284284

285285
match copy_exit_cmd_handle.map_err(PushProfileError::Copy)?.code() {
286286
Some(0) => (),
287-
a => return Err(PushProfileError::CopyExit(a)),
287+
a => error!("{}", PushProfileError::CopyExit(a)),
288288
};
289289

290290
Ok(())

0 commit comments

Comments
 (0)