Skip to content

Commit 4f18866

Browse files
committed
feat(errors): expose error enums (fixes hyperium#2462)
1 parent ed2fdb7 commit 4f18866

File tree

7 files changed

+121
-86
lines changed

7 files changed

+121
-86
lines changed

src/client/dispatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ mod tests {
317317
.expect("fulfilled")
318318
.expect_err("promise should error");
319319
match (err.0.kind(), err.1) {
320-
(&crate::error::Kind::Canceled, Some(_)) => (),
320+
(&crate::error::Kind::Canceled(_), Some(_)) => (),
321321
e => panic!("expected Error::Cancel(_), found {:?}", e),
322322
}
323323
}

src/client/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ where
5555
fn poll_ready(&mut self, cx: &mut task::Context<'_>) -> Poll<Result<(), Self::Error>> {
5656
self.inner
5757
.poll_ready(cx)
58-
.map_err(|e| crate::Error::new(crate::error::Kind::Connect).with(e.into()))
58+
.map_err(|e| crate::Error::new_connect(e))
5959
}
6060

6161
fn call(&mut self, req: T) -> Self::Future {
@@ -76,7 +76,7 @@ where
7676
Err(e) => Err(e),
7777
},
7878
Err(e) => {
79-
let err = crate::Error::new(crate::error::Kind::Connect).with(e.into());
79+
let err = crate::Error::new_connect(e);
8080
Err(err)
8181
}
8282
}

0 commit comments

Comments
 (0)