Skip to content

Commit

Permalink
wg-webclient/websocket: dont panic but log errors. Part of #86
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreddow committed Sep 24, 2024
1 parent b17a47f commit 7be0871
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions wg-webclient/src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ where
let read: usize = match stream.read(&mut buf) {
Ok(len) => len,
Err(e) => {
panic!("error while reading from stream: {}", e.to_string());
log::error!("error while reading from stream: {}", e.to_string());
return;
}
};
log::trace!("read len {}", read);
Expand All @@ -133,7 +134,8 @@ where
return;
}
Err(e) => {
panic!("error while parsing response: {}", e.to_string());
log::error!("error while parsing response: {}", e.to_string());
return;
}
};

Expand Down Expand Up @@ -176,7 +178,7 @@ where
}
}
},
_ => panic!(
_ => log::error!(
"error while reading from Websocket: {}",
e.to_string()
),
Expand Down

0 comments on commit 7be0871

Please sign in to comment.