diff --git a/bin/core/imag-link/Cargo.toml b/bin/core/imag-link/Cargo.toml
index dd503bef..20db392c 100644
--- a/bin/core/imag-link/Cargo.toml
+++ b/bin/core/imag-link/Cargo.toml
@@ -25,8 +25,9 @@ maintenance = { status = "actively-developed" }
log = "0.4.0"
url = "1.5"
toml = "0.4"
-toml-query = "0.7"
+toml-query = { git = "https://github.com/matthiasbeyer/toml-query", branch = "failure" }
prettytable-rs = "0.8"
+failure = "0.1"
libimagstore = { version = "0.9.0", path = "../../../lib/core/libimagstore" }
libimagrt = { version = "0.9.0", path = "../../../lib/core/libimagrt" }
diff --git a/bin/core/imag-link/src/main.rs b/bin/core/imag-link/src/main.rs
index 5a177308..e0b55149 100644
--- a/bin/core/imag-link/src/main.rs
+++ b/bin/core/imag-link/src/main.rs
@@ -35,6 +35,7 @@
#[macro_use] extern crate log;
extern crate clap;
extern crate url;
+extern crate failure;
#[macro_use] extern crate prettytable;
#[cfg(test)] extern crate toml;
#[cfg(test)] extern crate toml_query;
@@ -55,22 +56,24 @@ extern crate libimagutil;
use std::io::Write;
use std::path::PathBuf;
+use failure::Error;
+use failure::err_msg;
+
use libimagentrylink::external::ExternalLinker;
use libimagentrylink::internal::InternalLinker;
use libimagentrylink::internal::store_check::StoreLinkConsistentExt;
-use libimagentrylink::error::LinkError as LE;
use libimagerror::trace::{MapErrTrace, trace_error};
use libimagerror::exit::ExitUnwrap;
use libimagerror::io::ToExitCode;
use libimagrt::runtime::Runtime;
use libimagrt::setup::generate_runtime_setup;
-use libimagstore::error::StoreError;
use libimagstore::store::FileLockEntry;
use libimagstore::storeid::StoreId;
use libimagutil::warn_exit::warn_exit;
use libimagutil::warn_result::*;
use url::Url;
+use failure::Fallible as Result;
mod ui;
@@ -80,7 +83,7 @@ fn main() {
let version = make_imag_version!();
let rt = generate_runtime_setup("imag-link",
&version,
- "Add/Remove links between entries",
+ "Link entries",
build_ui);
if rt.cli().is_present("check-consistency") {
let exit_code = match rt.store().check_link_consistency() {
@@ -119,11 +122,11 @@ fn main() {
warn_exit("No commandline call", 1)
}
})
- .ok_or(LE::from("No commandline call".to_owned()))
+ .ok_or_else(|| Error::from(err_msg("No commandline call".to_owned())))
.map_err_trace_exit_unwrap(1);
}
-fn get_entry_by_name<'a>(rt: &'a Runtime, name: &str) -> Result