Closed jamesray1 closed 6 years ago
What about when I want to return something? Without error chain, the result of a function is often not ()
. Do I use Resulterror-chain = "0.11.0"
in cargo.toml,
#[macro_use]
extern crate error_chain;
in lib.rs, pub mod errors;
in mod.rs, in error_chain!{}
in errors.rs, etc.
Closing for now as I think I'm getting the hang of it. The errors that I was getting were unrelated.
I've read over the documentation a few times now, but I am not sure what is the best way to integrate error_chain with the whole project. I've already used the quickstart example to modify the main executable. The project has one executable but it also serves as a library. However I'm not sure what the best way is to integrate error_chain in each crate. For example if I have an error in a file in a module of a crate, how should I integrate that with error_chain in each crate?
More specifically, this file configures the Rust environment variable. How would I integrate the errors in these files with error-chain? There are also other errors in other files in other crate folders.