surf::Exception does not implement std::error::Error
Open
- Dominant language
- Rust
- Stars
- 1.5k
- Forks
- 128
- PR merge metrics
- No merged PRs in 30d
Description
This is an unfriendly choice for errors returned by a library because it makes them not work with `?`.
```rust
async fn repro() -> Result<(), failure::Error> {
let _ = surf::get("https://www.rust-lang.org").await?; // doesn't work
Ok(())
}
```
```rust
async fn repro() -> anyhow::Result<()> {
let _ = surf::get("https://www.rust-lang.org").await?; // doesn't work
Ok(())
}
```
Application-focused error types like failure::Error are built on `impl From` which is why it matters that library errors implement std::error::Error.
Contributor guide
Assessment
This issue has not been assessed yet.