Package-level declarations
Overview
Domain-specific exceptions that signal invalid operations or corrupted persisted files (for example: malformed board or piece entries). These exceptions are thrown by the core logic or by the serializers when encountering invalid data.
Exception Types
ReversiException— Base exception for all Reversi-specific errorsErrorType— Enum categorizing error severity (INFO, WARNING, ERROR, FATAL)InvalidPlayException— Thrown when attempting to play an invalid moveInvalidGameException— Thrown when game operations are invoked on an unstarted gameInvalidPieceInFileException— Thrown when a persisted file contains malformed piece dataInvalidPieceTypeInFileException— Thrown when an invalid piece type is encountered in a fileInvalidPlayerInFileException— Thrown when player data in a file is malformedInvalidGameStateInFileException— Thrown when the overall game state file is corruptedInvalidBoardInFile— Thrown when board data in a file is invalidInvalidFile— General exception for file parsing errorsInvalidNameAlreadyExists— Thrown when attempting to create a game with a name that already existsEndGame— Thrown when the game has ended (not an error, but a state signal)BadStorage— Thrown when storage operations fail
Responsibilities
Providing clear, user-friendly error messages
Distinguishing between user errors and system errors
Supporting graceful error handling throughout the application
Enabling specific error handling for different failure scenarios
Types
Thrown when the storage system fails a health check or encounters a critical error. Indicates that the storage backend is not functioning correctly and may require attention.
Thrown when the game has ended, either due to a winner being determined or both players passing consecutively.
Thrown when the board representation in the persisted game file is malformed or contains values that cannot be converted into a valid pt.isel.reversi.core.board.Board.
Thrown when an operation on a file or storage entity fails. This can occur when loading, saving, or deleting game states from persistent storage.
Thrown when an operation is invoked on an invalid or uninitialized game. Examples: calling play or pass when the game has not been started.
Thrown when a game state in the persisted game file is malformed or contains values that cannot be converted into a valid game state.
Thrown when attempting to create a game with a name that already exists in storage.
Thrown when a piece line in the persisted game file is malformed or contains values that cannot be converted into a valid pt.isel.reversi.core.board.Piece.
Thrown when a pieceType line in the persisted game file is malformed or contains values that cannot be converted into a valid pt.isel.reversi.core.board.PieceType.
Thrown when an attempted play is invalid according to Reversi rules. Reasons include: position already occupied, play does not capture any opponent pieces, or the coordinate is out of bounds.
Thrown when a player line in the persisted game file is malformed or contains values that cannot be converted into a valid pt.isel.reversi.core.gameState.Player.
Base exception class for Reversi game-related errors.