Skip to content

Commit

Permalink
Log stream close errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Aug 30, 2024
1 parent fac6ecb commit 11c01a5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ntex-compio/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ impl IoStream for crate::TcpStream {
compio::runtime::spawn(async move {
run(&mut io, &read, write).await;

let res = io.close().await;
log::debug!("{} Stream is closed, {:?}", read.tag(), res);
match io.close().await {
Ok(_) => log::debug!("{} Stream is closed", read.tag()),
Err(e) => log::error!("{} Stream is closed, {:?}", read.tag(), e),

Check warning on line 20 in ntex-compio/src/io.rs

View check run for this annotation

Codecov / codecov/patch

ntex-compio/src/io.rs#L18-L20

Added lines #L18 - L20 were not covered by tests
}
})
.detach();

Expand All @@ -31,8 +33,10 @@ impl IoStream for crate::UnixStream {
compio::runtime::spawn(async move {
run(&mut io, &read, write).await;

let res = io.close().await;
log::debug!("{} Stream is closed, {:?}", read.tag(), res);
match io.close().await {
Ok(_) => log::debug!("{} Unix stream is closed", read.tag()),
Err(e) => log::error!("{} Unix stream is closed, {:?}", read.tag(), e),

Check warning on line 38 in ntex-compio/src/io.rs

View check run for this annotation

Codecov / codecov/patch

ntex-compio/src/io.rs#L36-L38

Added lines #L36 - L38 were not covered by tests
}
})
.detach();

Expand Down

0 comments on commit 11c01a5

Please sign in to comment.