Handle errors properly in rustbook.
Silently ignoring errors is :( so lets not silently ignore them. huon is :) now.
This commit is contained in:
parent
4247a30bdd
commit
80fb5ca874
4 changed files with 20 additions and 22 deletions
|
@ -54,7 +54,12 @@ fn main() {
|
|||
Ok(_) => {
|
||||
match subcmd.execute(&mut term) {
|
||||
Ok(_) => (),
|
||||
Err(_) => os::set_exit_status(-1),
|
||||
Err(err) => {
|
||||
term.err(&format!("error: {}", err.description())[]);
|
||||
err.detail().map(|detail| {
|
||||
term.err(&format!("detail: {}", detail)[]);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue