From 3803bc02ab14816c7dd1187f47652f171f28d72c Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Thu, 29 Oct 2020 12:57:39 +0700 Subject: [PATCH] Add error messages when deser fails --- src/bc_protocol/connection.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bc_protocol/connection.rs b/src/bc_protocol/connection.rs index 7003b6a..935ac91 100644 --- a/src/bc_protocol/connection.rs +++ b/src/bc_protocol/connection.rs @@ -55,7 +55,15 @@ impl BcConnection { let rx_thread = std::thread::spawn(move || { let mut context = BcContext::new(); - while BcConnection::poll(&mut context, &conn, &mut subs).is_ok() {} + while { + match BcConnection::poll(&mut context, &conn, &mut subs) { + Ok(_) => true, + Err(err) => { + error!("Deserialization error: {}", err); + false + } + } + } {} }); Ok(BcConnection {