Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions chess/4-database/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ boolean verifyUser(String username, String providedClearTextPassword) {

The above code demonstrates the necessary concepts to implement secure password storage, but it will need to be adapted to your particular implementation. You do not need to create a different table to store your passwords. The hashed password may be stored along with your other user information in your `user` table.

## Error Handling

Now that your database is stored in MySQL, you must account for any errors trying to connect to that program. If any exception is thrown while an endpoint is trying to access the database, this should be considered an `Internal Server Error`, and an appropriate response must be handled. The status code must be set to `500` and the body of each of these responses must include a reasonable, relevant error message. You may recall this specification from [Phase 3](../3-web-api/web-api.md#endpoint-specifications).

## ChessGame Serialization/Deserialization

The easiest way to store the state of a ChessGame in MySQL is to serialize it to a JSON string, and then store the string in your database. Whenever your server needs to update the state of a game, it should:
Expand Down