radix-router icon indicating copy to clipboard operation
radix-router copied to clipboard

type Error should not be hyper::Error

Open MarkSwanson opened this issue 5 years ago • 2 comments

I'm testing out hyper and radix-router and I've noticed that it's not possible to create a hyper::Error (by design). The problem is that radix-router BoxFut forces you to create a hyper::Error on error. This means I can't use Rust Futures the way they were designed ( for_each() is designed to break out on Err - but I can't create a hyper::Error). It seems I posted this as a hyper issue, but it seems to be a radix-router issue instead. https://github.com/hyperium/hyper/issues/1658

Would the proper way to fix this (enable folks to use Rust futures for_each() etc.) be to change the radix-router Error type to something compatible with std::Error / failure::Error ?

Or, am I misusing the Error type in some way and there is already a best practice for handling this?

Thanks!

MarkSwanson avatar Oct 01 '18 05:10 MarkSwanson