-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log result of the command before returning from main #1302
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1302 +/- ##
==========================================
- Coverage 68.97% 68.96% -0.01%
==========================================
Files 119 119
Lines 12557 12560 +3
==========================================
+ Hits 8661 8662 +1
- Misses 3896 3898 +2 |
crates/youki/src/main.rs
Outdated
}; | ||
|
||
if let Err(ref e) = output { | ||
log::error!("error in executing command : {:?}", e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log::error!("error in executing command : {:?}", e); | |
log::error!("error in executing command: {:?}", e); |
crates/youki/src/main.rs
Outdated
@@ -97,7 +97,7 @@ fn main() -> Result<()> { | |||
let root_path = determine_root_path(opts.global.root)?; | |||
let systemd_cgroup = opts.global.systemd_cgroup; | |||
|
|||
match opts.subcmd { | |||
let output = match opts.subcmd { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing the name of the variable?
let output = match opts.subcmd { | |
let cmd_result = match opts.subcmd { |
Signed-off-by: Yashodhan Joshi <yjdoc2@gmail.com>
08b47a9
to
e8c5d6a
Compare
@utam0k PTAL, have made both of the suggested changes 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This will log the error if there was any when executing the command. This will help in trying to figure out what was the issue from the logs, as right now, we do not get any info about it from the logs. This was particularly irritating when trying to fix the containerd test, as it would just report
runtime exited with 1
, and even the logs would not show anything.Signed-off-by: Yashodhan Joshi yjdoc2@gmail.com