Closed najamelan closed 5 years ago
Yeah, revisiting NngFail/Return/etc has been on my to-do list, think there's a few FIXMEs sprinkled around as well. Was looking at the error-chain crate, but I hadn't heard things are headed towards failure
.
I admit I have never used error-chain
, but I think the approach of failure
makes a lot of sense and is an evolution from lessons learned from error-chain
. So much that withoutboats
is now employed by mozilla and they are reworking error handling in the standard library.
It would be nice to be able to use the
?
operator in functions that can also throw other errors thanNngFail
. The most recent work on making error handling smoother in rust is thefailure
crate. It would be nice to provide compatibility with that. It can be done by derivingfailure::Fail
for your error, or if you don't want the extra dependency, implementingstd::error::Error
as described here in the docs.If you're low on time I could make a pull request for this one, but you'd have to decide whether you prefer std::error or failure.
btw off topic: I am trying to see how I will use runng and actix in my project, so I made a small test repository where I try different ways to get it to work. It might at some point serve as example code for runng. Currently it's not very documented, but just wanted to let you know it exists. Every commit is a different working example. It will definitely evolve over the next few days, because it's not at all satisfying right now. Next I will look into the async api and improve the way I invoke actix.