aboutsummaryrefslogtreecommitdiff
path: root/pixel-client/src/game.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pixel-client/src/game.rs')
-rw-r--r--pixel-client/src/game.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/pixel-client/src/game.rs b/pixel-client/src/game.rs
index 59b30ad0..1f74d491 100644
--- a/pixel-client/src/game.rs
+++ b/pixel-client/src/game.rs
@@ -116,7 +116,10 @@ impl Game {
keyboard: &KeyboardState,
layout: &AtlasLayout,
) -> Option<Box<State>> {
- self.network.poll().unwrap();
+ if let Err(e) = self.network.poll() {
+ eprintln!("network error: {e}");
+ return Some(Box::new(State::Quit));
+ }
// TODO perf
for packet in self.network.queue_in.drain(..).collect::<Vec<_>>() {