Add debugging output in handle_external_linking()
This commit is contained in:
parent
b9800ba008
commit
0c970263ce
1 changed files with 8 additions and 0 deletions
|
@ -194,21 +194,25 @@ fn handle_external_linking(rt: &Runtime) {
|
|||
let mut entry = entry.unwrap();
|
||||
|
||||
if scmd.is_present("add") {
|
||||
debug!("Adding link to entry!");
|
||||
add_link_to_entry(rt.store(), scmd, &mut entry);
|
||||
return;
|
||||
}
|
||||
|
||||
if scmd.is_present("remove") {
|
||||
debug!("Removing link from entry!");
|
||||
remove_link_from_entry(rt.store(), scmd, &mut entry);
|
||||
return;
|
||||
}
|
||||
|
||||
if scmd.is_present("set") {
|
||||
debug!("Setting links in entry!");
|
||||
set_links_for_entry(rt.store(), scmd, &mut entry);
|
||||
return;
|
||||
}
|
||||
|
||||
if scmd.is_present("list") {
|
||||
debug!("Listing links in entry!");
|
||||
list_links_for_entry(rt.store(), &mut entry);
|
||||
return;
|
||||
}
|
||||
|
@ -221,14 +225,18 @@ fn add_link_to_entry(store: &Store, matches: &ArgMatches, entry: &mut FileLockEn
|
|||
|
||||
let link = Url::parse(link);
|
||||
if link.is_err() {
|
||||
debug!("URL parsing error...");
|
||||
trace_error(&link.err().unwrap());
|
||||
debug!("Exiting");
|
||||
exit(1);
|
||||
}
|
||||
let link = link.unwrap();
|
||||
|
||||
if let Err(e) = entry.add_external_link(store, link) {
|
||||
debug!("Error while adding external link...");
|
||||
trace_error(&e);
|
||||
} else {
|
||||
debug!("Everything worked well");
|
||||
info!("Ok");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue