summaryrefslogtreecommitdiffstats
path: root/bin/domain
diff options
context:
space:
mode:
Diffstat (limited to 'bin/domain')
-rw-r--r--bin/domain/imag-notes/Cargo.toml1
-rw-r--r--bin/domain/imag-notes/src/main.rs13
2 files changed, 13 insertions, 1 deletions
diff --git a/bin/domain/imag-notes/Cargo.toml b/bin/domain/imag-notes/Cargo.toml
index 2d77b65f..9d4091e8 100644
--- a/bin/domain/imag-notes/Cargo.toml
+++ b/bin/domain/imag-notes/Cargo.toml
@@ -29,3 +29,4 @@ libimagerror = { version = "0.6.0", path = "../../../lib/core/libimagerror"
libimagnotes = { version = "0.6.0", path = "../../../lib/domain/libimagnotes" }
libimagentryedit = { version = "0.6.0", path = "../../../lib/entry/libimagentryedit" }
libimagutil = { version = "0.6.0", path = "../../../lib/etc/libimagutil" }
+libimagstore = { version = "0.6.0", path = "../../../lib/core/libimagstore" }
diff --git a/bin/domain/imag-notes/src/main.rs b/bin/domain/imag-notes/src/main.rs
index d04208e6..35b38b0a 100644
--- a/bin/domain/imag-notes/src/main.rs
+++ b/bin/domain/imag-notes/src/main.rs
@@ -26,15 +26,21 @@ extern crate libimagrt;
extern crate libimagentryedit;
extern crate libimagerror;
extern crate libimagutil;
+extern crate libimagstore;
+
+use std::process::exit;
use itertools::Itertools;
use libimagentryedit::edit::Edit;
use libimagrt::runtime::Runtime;
use libimagrt::setup::generate_runtime_setup;
+use libimagstore::iter::get::StoreIdGetIteratorExtension;
use libimagnotes::note::Note;
use libimagnotes::notestore::*;
use libimagerror::trace::MapErrTrace;
+use libimagerror::trace::trace_error_exit;
+use libimagerror::iter::TraceIterator;
use libimagutil::info_result::*;
use libimagutil::warn_result::WarnResult;
@@ -114,7 +120,12 @@ fn list(rt: &Runtime) {
.store()
.all_notes()
.map_err_trace_exit_unwrap(1)
- .filter_map(|noteid| rt.store().get(noteid).map_err_trace_exit_unwrap(1))
+ .into_get_iter(rt.store())
+ .unwrap_with(|e| trace_error_exit(&e, 1))
+ .map(|opt| opt.unwrap_or_else(|| {
+ error!("Fatal: Nonexistent entry where entry should exist");
+ exit(1)
+ }))
.sorted_by(|note_a, note_b| if let (Ok(a), Ok(b)) = (note_a.get_name(), note_b.get_name()) {
return a.cmp(&b)
} else {