From e585df2576c19863b26f02ad98be59890b8aa3dc Mon Sep 17 00:00:00 2001 From: Min Kim Date: Fri, 17 May 2024 10:10:52 -0700 Subject: [PATCH] Use `Other` for `ReadError::ClosedStream` `NotFound` is nog applicable for `ReadError::ClosedStream` as it is not a stream that is not found, but a stream that is closed. --- src/frame.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frame.rs b/src/frame.rs index 3ccf7b3..63feb2e 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -63,7 +63,7 @@ fn from_read_error_to_io_error(e: quinn::ReadError) -> io::Error { match e { ReadError::Reset(_) => io::Error::from(io::ErrorKind::ConnectionReset), ReadError::ConnectionLost(e) => from_connection_error_to_io_error(e), - ReadError::ClosedStream => io::Error::new(io::ErrorKind::NotFound, "unknown stream"), + ReadError::ClosedStream => io::Error::new(io::ErrorKind::Other, "closed stream"), ReadError::IllegalOrderedRead => { io::Error::new(io::ErrorKind::InvalidInput, "illegal ordered read") }