Skip to content

Commit

Permalink
Log decoding error
Browse files Browse the repository at this point in the history
  • Loading branch information
adzialocha committed Dec 8, 2024
1 parent 6a2fc0f commit 69a55c3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub fn run() -> Result<(
let sync = LogSyncProtocol::new(documents_store.clone(), operations_store.clone());
let sync_config = SyncConfiguration::<TextDocument>::new(sync);

let mut network = NetworkBuilder::new(*network_id.as_bytes())
let mut network = NetworkBuilder::new(network_id.into())
.sync(sync_config)
.private_key(private_key.clone())
.discovery(LocalDiscovery::new().unwrap())
Expand Down Expand Up @@ -136,7 +136,13 @@ pub fn run() -> Result<(
FromNetwork::GossipMessage {
bytes,
delivered_from,
} => decode_gossip_message(&bytes).ok(),
} => match decode_gossip_message(&bytes) {
Ok(result) => Some(result),
Err(err) => {
eprintln!("could not decode gossip message: {err}");
None
}
},
FromNetwork::SyncMessage {
header,
payload,
Expand Down

0 comments on commit 69a55c3

Please sign in to comment.