Merge pull request #597 from asuivelentine/imag-view/refactor

shorten exit on error
This commit is contained in:
Matthias Beyer 2016-07-30 20:15:57 +02:00 committed by GitHub
commit a559fdff07

View file

@ -28,7 +28,7 @@ use std::process::exit;
use std::path::PathBuf; use std::path::PathBuf;
use libimagrt::setup::generate_runtime_setup; use libimagrt::setup::generate_runtime_setup;
use libimagerror::trace::trace_error; use libimagerror::trace::trace_error_exit;
use libimagentryview::builtin::stdout::StdoutViewer; use libimagentryview::builtin::stdout::StdoutViewer;
use libimagentryview::builtin::versions::VersionsViewer; use libimagentryview::builtin::versions::VersionsViewer;
use libimagentryview::viewer::Viewer; use libimagentryview::viewer::Viewer;
@ -62,8 +62,7 @@ fn main() {
exit(1); exit(1);
} }
Err(e) => { Err(e) => {
trace_error(&e); trace_error_exit(&e, 1);
exit(1); // we can afford not-executing destructors here
} }
}; };
@ -85,8 +84,7 @@ fn main() {
}; };
if let Err(e) = res { if let Err(e) = res {
trace_error(&e); trace_error_exit(&e, 1);
exit(1);
} }
} }