Managing Game Start Errors in Wordz
Explore techniques for managing game start errors in a Wordz microservice by test-driving appropriate HTTP responses like 409 Conflict. Understand how to maintain test isolation when running endpoint tests and apply best practices to ensure reliable, readable, and concise code.
We'll cover the following...
We'll cover the following...
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.
We write the test to return a
409 Conflictif the game is already in progress: