Open kvzn opened 2 years ago
Just in case anyone is looking for a workaround for the time being, you can do
#[derive(Debug, Error)]
pub enum Error {
/// Network error (surf)
#[error("Failed to make a request: {0:?}")]
Http(surf::Error),
}
impl From<surf::Error> for Error {
fn from(err: surf::Error) -> Self {
Error::Http(err)
}
}
I'm working on this but is requires a lot of changed to http-types first so it'l be a while at least
Shame for making an error type that doesn't implement Error
. How silly. Who needs standards anyway?
@spikespaz Shame on you for trying to shame people who had no involvement in the original creation and who spent a bunch of time trying to fix it.
Did you try to fix it? Do you even realize that this project predated thiserror's wide acceptance?
Anyways I am marking these as off topic. You can contribute or not.
@spikespaz Shame on you for trying to shame people who had no involvement in the original creation and who spent a bunch of time trying to fix it.
Did you try to fix it? Do you even realize that this project predated thiserror's wide acceptance?
Anyways I am marking these as off topic. You can contribute or not.
Then shame on the original authors. And your statement about predating thiserror
doesn't matter, it didn't predate std::error::Error
and that is my point.
Add thiserror
to Cargo.toml, It can fix that for me.
It's the same situation with this issue: https://github.com/dtolnay/thiserror/issues/118
When I use Surf with thiserror like that:
I got issue:
Can you solve this? Many thanks!