fix(machines): Don't warn on expected end-of-input errors (#15)
This commit is contained in:
parent
f457c44d24
commit
a5a027690a
2 changed files with 5 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
use log::{debug, warn};
|
use log::debug;
|
||||||
use minicbor::{Decoder, Encoder};
|
use minicbor::{Decoder, Encoder};
|
||||||
use pallas_multiplexer::Payload;
|
use pallas_multiplexer::Payload;
|
||||||
use std::{
|
use std::{
|
||||||
|
|
@ -142,9 +142,8 @@ impl<'a> PayloadDeconstructor<'a> {
|
||||||
debug!("consumed {} from payload buffer", new_pos);
|
debug!("consumed {} from payload buffer", new_pos);
|
||||||
Ok(t)
|
Ok(t)
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(_err) => {
|
||||||
//TODO: we need to filter this only for correct errors
|
//TODO: we need to match EndOfInput kind of errors
|
||||||
warn!("{:?}", err);
|
|
||||||
|
|
||||||
debug!("payload incomplete, fetching next segment");
|
debug!("payload incomplete, fetching next segment");
|
||||||
let payload = self.rx.recv()?;
|
let payload = self.rx.recv()?;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use std::{
|
||||||
time::{Duration, Instant},
|
time::{Duration, Instant},
|
||||||
};
|
};
|
||||||
|
|
||||||
use log::{debug, error, trace, warn};
|
use log::{debug, error, warn};
|
||||||
|
|
||||||
pub trait Bearer: Read + Write + Send + Sync + Sized {
|
pub trait Bearer: Read + Write + Send + Sync + Sized {
|
||||||
fn read_segment(&mut self) -> Result<(u16, u32, Payload), std::io::Error>;
|
fn read_segment(&mut self) -> Result<(u16, u32, Payload), std::io::Error>;
|
||||||
|
|
@ -49,7 +49,7 @@ where
|
||||||
}
|
}
|
||||||
Err(TryRecvError::Disconnected) => {
|
Err(TryRecvError::Disconnected) => {
|
||||||
//TODO: remove handle from list
|
//TODO: remove handle from list
|
||||||
trace!("protocol handle {} disconnected", id);
|
warn!("protocol handle {} disconnected", id);
|
||||||
}
|
}
|
||||||
Err(TryRecvError::Empty) => (),
|
Err(TryRecvError::Empty) => (),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue