tokio-xmpp: improve error logging
This commit is contained in:
parent
2cd1ad217b
commit
3e2b51f148
1 changed files with 5 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use crate::{ParseError, ParserError};
|
use crate::{ParseError, ParserError};
|
||||||
use bytes::{BufMut, BytesMut};
|
use bytes::{BufMut, BytesMut};
|
||||||
use log::debug;
|
use log::{debug, error};
|
||||||
use std;
|
use std;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::vec_deque::VecDeque;
|
use std::collections::vec_deque::VecDeque;
|
||||||
|
|
@ -250,7 +250,7 @@ impl Decoder for XMPPCodec {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
// println!("error {} at {}/{} in {:?}", e, e.valid_up_to(), buf1.len(), buf1);
|
error!("error {} at {}/{} in {:?}", e, e.valid_up_to(), buf1.len(), buf1);
|
||||||
return Err(ParserError::Utf8(e));
|
return Err(ParserError::Utf8(e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -309,7 +309,9 @@ impl Encoder for XMPPCodec {
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.map_err(to_io_err),
|
.map_err(to_io_err),
|
||||||
Packet::StreamEnd => write!(dst, "</stream:stream>\n").map_err(to_io_err),
|
Packet::StreamEnd =>
|
||||||
|
write!(dst, "</stream:stream>\n")
|
||||||
|
.map_err(to_io_err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue