holochain / holochain-rust

DEPRECATED. The Holochain framework implemented in rust with a redux style internal state-model.
GNU General Public License v3.0
1.12k stars 269 forks source link

Using link_entries with an unspecified tag should return a useful error message #1040

Open marcusnewton opened 5 years ago

marcusnewton commented 5 years ago

For the tag: S argument in link_entries, if the tag you input doesn't exist for the entry type, the error returned is:

{ Err:
   { Internal:
      '{"kind":{"ErrorGeneric":"Unknown entry type"},"file":"C:\\\\Users\\\\travis\\\\build\\\\holochain\\\\holochain-rust\\\\core\\\\src\\\\nucleus\\\\ribosome\\\\runtime.rs","line":"131"}' } }

Took me some time to figure out that I typed article_from_keyword for link_entries in a zome function when the tag specified in the zome entry was called articles_from_keyword

willemolding commented 5 years ago

Link tags (now called link types) and link tags are now handled differently as of #1453. Does this difficult to interpret error still occur?

marcusnewton commented 5 years ago

@willemolding It's been awhile. I'd have to take some time to reproduce the issue. Gimme a sec

pdaoust commented 5 years ago

@willemolding I think the issue is that find_link_definition_in_dna() has some pretty grainy error messages -- the same message for missing base entry, target entry, or link types. I've been trying to learn Rust and the nix-shell-based dev env so I can improve on the messaging, but I've been getting tangled up in the control flow in that function :D