Do not hide the error here, yell it out!

This commit is contained in:
Matthias Beyer 2016-07-06 19:53:47 +02:00
parent 84890bf8fc
commit b78da80717

View file

@ -94,8 +94,8 @@ fn tw_hook(rt: &Runtime) {
let stdin = stdin(); let stdin = stdin();
let stdin = stdin.lock(); let stdin = stdin.lock();
if let Ok(ttasks) = import_tasks(stdin) { match import_tasks(stdin) {
for ttask in ttasks { Ok(ttasks) => for ttask in ttasks {
if counter % 2 == 1 { if counter % 2 == 1 {
// Only every second task is needed, the first one is the // Only every second task is needed, the first one is the
// task before the change, and the second one after // task before the change, and the second one after
@ -124,9 +124,11 @@ fn tw_hook(rt: &Runtime) {
} // end match ttask.status() } // end match ttask.status()
} // end if c % 2 } // end if c % 2
counter += 1; counter += 1;
} // end for },
} else { Err(e) => {
error!("No usable input"); trace_error(&e);
exit(1);
},
} }
} else { } else {
// Should not be possible, as one argument is required via // Should not be possible, as one argument is required via