http-rs / http-types

Common types for HTTP operations
https://docs.rs/http-types
Apache License 2.0
200 stars 84 forks source link

Expose reference of inner anyhow error #369

Closed pbzweihander closed 3 years ago

pbzweihander commented 3 years ago

It would be great if http_types::Error exposes the reference of inner anyhow::Error.

Especially, when using backtrace feature of anyhow in stable rust, I cannot get backtraces without losing status and type_name information. But if I can get the reference of anyhow::Error, I can without losing information.

jbr commented 3 years ago

Could this be an impl AsRef<anyhow::Error> for http_types::Error?

pbzweihander commented 3 years ago

@jbr I updated the PR with impl AsRef<anyhow::Error> for http_types::Error!

jbr commented 3 years ago

Thanks!