Managing Game Start Errors in Wordz

Handle errors during game initiation in the Wordz application to prevent game restarts when a session is already active by returning a clear HTTP status code to client requests.

Handling errors when starting a game

One of our design decisions is that a player cannot start a game when one is in progress. We need to test-drive this behavior. We choose to return an HTTP status of 409 Conflict to indicate that a game is already in progress for a player and a new one cannot be started for them:

  • Write the test to return a 409 Conflict if the game is already in progress:

Get hands-on with 1200+ tech skills courses.