Refactor errors internals (#556)
h2::Error now knows whether protocol errors happened because the user sent them, because it was received from the remote peer, or because the library itself emitted an error because it detected a protocol violation. It also keeps track of whether it came from a RST_STREAM or GO_AWAY frame, and in the case of the latter, it includes the additional debug data if any. Fixes #530
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
use crate::SendFrame;
|
||||
|
||||
use h2::frame::{self, Frame};
|
||||
use h2::{self, RecvError, SendError};
|
||||
use h2::proto::Error;
|
||||
use h2::{self, SendError};
|
||||
|
||||
use futures::future::poll_fn;
|
||||
use futures::{ready, Stream, StreamExt};
|
||||
@@ -284,7 +285,7 @@ impl Handle {
|
||||
}
|
||||
|
||||
impl Stream for Handle {
|
||||
type Item = Result<Frame, RecvError>;
|
||||
type Item = Result<Frame, Error>;
|
||||
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
Pin::new(&mut self.codec).poll_next(cx)
|
||||
|
||||
Reference in New Issue
Block a user