Skip to content

Commit 282bda7

Browse files
committed
Client (chat): catch specific instead of bare exceptions
1 parent ba869c4 commit 282bda7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

client/chat_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def thread_output(text_area):
1818
while True:
1919
try:
2020
state = game.state()
21-
except Exception as e:
21+
except GameServerError as e:
2222
print(e)
2323
window.destroy()
2424

@@ -54,7 +54,9 @@ def entry_handler(_):
5454

5555
try:
5656
game.move(message=message)
57-
except Exception as e:
57+
except IllegalMove as e:
58+
print(e)
59+
except GameServerError as e:
5860
window.destroy()
5961
raise e
6062

0 commit comments

Comments
 (0)