aboutsummaryrefslogtreecommitdiff
path: root/pixel-client/src/game.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-08-16 13:09:11 +0200
committermetamuffin <metamuffin@disroot.org>2024-08-16 13:09:11 +0200
commit18e7880e580d3727ad03606a7c2a1e789a9a532b (patch)
tree9f191d67e4e9e76947393b68c5f09811915623f4 /pixel-client/src/game.rs
parentef3bb78900d3f552b8089b5a82c3a963763a61e9 (diff)
downloadhurrycurry-18e7880e580d3727ad03606a7c2a1e789a9a532b.tar
hurrycurry-18e7880e580d3727ad03606a7c2a1e789a9a532b.tar.bz2
hurrycurry-18e7880e580d3727ad03606a7c2a1e789a9a532b.tar.zst
better error handling
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<_>>() {