Oops
This commit is contained in:
Binary file not shown.
@@ -36,7 +36,6 @@ class GameController:
|
|||||||
self._game_service.start(white_name, black_name, time_control, increment)
|
self._game_service.start(white_name, black_name, time_control, increment)
|
||||||
self._has_started = True
|
self._has_started = True
|
||||||
return jsonify({"status": "ok", "message": "Game started"}), 200
|
return jsonify({"status": "ok", "message": "Game started"}), 200
|
||||||
|
|
||||||
except ServiceException as ex:
|
except ServiceException as ex:
|
||||||
return jsonify({"status": "error", "message": f"An error occurred : {ex}"}), 400
|
return jsonify({"status": "error", "message": f"An error occurred : {ex}"}), 400
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
|||||||
@@ -29,12 +29,9 @@ class GameService:
|
|||||||
def make_move(self) -> tuple[bytes, str] | None:
|
def make_move(self) -> tuple[bytes, str] | None:
|
||||||
try :
|
try :
|
||||||
if not self._has_started :
|
if not self._has_started :
|
||||||
raise ServiceException("Game hasn't started yet.")
|
raise Exception("Game hasn't started yet.")
|
||||||
self._clock_service.switch()
|
self._clock_service.switch()
|
||||||
return self._detection_service.analyze_single_frame()
|
return self._detection_service.analyze_single_frame()
|
||||||
except ServiceException as se:
|
except Exception as e:
|
||||||
print(se)
|
print(e)
|
||||||
return None
|
raise ServiceException(e)
|
||||||
except Exception as ex:
|
|
||||||
print(ex)
|
|
||||||
return None
|
|
||||||
|
|||||||
Reference in New Issue
Block a user