Add ID reporting in imag-ref

This commit is contained in:
Matthias Beyer 2018-11-02 10:57:42 +01:00
parent 502cdf5721
commit c616a5cfaf

View file

@ -88,16 +88,20 @@ fn deref(rt: &Runtime) {
.map_err_trace_exit_unwrap(1); .map_err_trace_exit_unwrap(1);
match rt.store().get(id.clone()).map_err_trace_exit_unwrap(1) { match rt.store().get(id.clone()).map_err_trace_exit_unwrap(1) {
Some(entry) => entry Some(entry) => {
.get_path() entry
.map_err_trace_exit_unwrap(1) .get_path()
.to_str() .map_err_trace_exit_unwrap(1)
.ok_or_else(|| { .to_str()
error!("Could not transform path into string!"); .ok_or_else(|| {
exit(1) error!("Could not transform path into string!");
}) exit(1)
.map(|s| info!("{}", s)) })
.ok(), // safe here because we exited already in the error case .map(|s| info!("{}", s))
.ok(); // safe here because we exited already in the error case
let _ = rt.report_touched(&id).map_err_trace_exit_unwrap(1);
},
None => { None => {
error!("No entry for id '{}' found", id); error!("No entry for id '{}' found", id);
exit(1) exit(1)