Skip to content

Commit

Permalink
WIP better panic messages
Browse files Browse the repository at this point in the history
  • Loading branch information
orblivion committed Dec 12, 2023
1 parent f7bff89 commit 4d7a7d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions squire_sdk/src/server/gathering/hall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ where
GatheringHallMessage::NewGathering(id) => self.process_new_gathering(id).await,
GatheringHallMessage::NewConnection(id, user, ws) => {
if !self.process_new_onlooker(id, user, ws).await {
panic!("TODO what if this fails")
panic!("process_new_onlooker failed")
}
}
GatheringHallMessage::Persist => {
Expand All @@ -106,7 +106,7 @@ where
let (send, recv) = oneshot_channel();
let msg = GatheringMessage::GetTournament(send);
if !sender.send(msg) {
panic!("TODO what if this fails")
panic!("GatheringMessage::GetTournament failed")
}
let tourn = recv.await.unwrap();
let _ = persist_reqs.insert(id, tourn);

Check failure on line 112 in squire_sdk/src/server/gathering/hall.rs

View workflow job for this annotation

GitHub Actions / Tests (beta, ubuntu-latest)

Diff in /home/runner/work/SquireCore/SquireCore/squire_sdk/src/server/gathering/hall.rs
Expand All @@ -116,7 +116,7 @@ where
.drain()
.for_each(|(_, tourn)| {
if !self.persister.send(tourn) {
panic!("TODO what if this fails")
panic!("Failed to persist tournament")
};
});
schedule_persist(scheduler);
Expand Down
2 changes: 1 addition & 1 deletion squire_sdk/src/server/tournaments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ async fn handle_new_onlooker<S: ServerState>(state: S, id: TournamentId, mut ws:
};
let user = state.watch_session(session).await.unwrap();
if !state.handle_new_onlooker(id, user, ws).await {
panic!("Failed to handle new onlooker")
panic!("handle_new_onlooker failed")
}
}

0 comments on commit 4d7a7d3

Please sign in to comment.