Constrain channel search, add better error message

This commit is contained in:
Dominik Werder
2022-02-16 12:50:34 +01:00
parent ded29874cb
commit 264c4307b9
7 changed files with 80 additions and 28 deletions

View File

@@ -1,6 +1,5 @@
use std::fmt;
#[derive(Debug)]
pub struct Error(::err::Error);
impl Error {
@@ -33,6 +32,12 @@ impl Error {
}
}
impl fmt::Debug for Error {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt::Debug::fmt(&self.0, fmt)
}
}
impl fmt::Display for Error {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt::Display::fmt(&self.0, fmt)

View File

@@ -426,15 +426,15 @@ where
Ok(r) => match r {
Ready(Some(Ok(k))) => Ready(Some(Ok(k))),
Ready(Some(Err(e))) => {
error!("body stream error: {:?}", e);
error!("body stream error: {e:?}");
Ready(Some(Err(Error::from(e))))
}
Ready(None) => Ready(None),
Pending => Pending,
},
Err(e) => {
error!("panic caught in httpret::BodyStream: {:?}", e);
let e = Error::with_msg(format!("panic caught in httpret::BodyStream: {:?}", e));
error!("panic caught in httpret::BodyStream: {e:?}");
let e = Error::with_msg(format!("panic caught in httpret::BodyStream: {e:?}"));
Ready(Some(Err(e)))
}
}