diff options
author | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-03-29 23:03:05 +0200 |
---|---|---|
committer | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-03-29 23:03:05 +0200 |
commit | 6e44f62f44847643a697e56f42dbec77b72a5581 (patch) | |
tree | af90d2f860d237a7492c4e3b79a52d9b0d8512bc /swiftstory/SwiftStory.py | |
parent | 99c3ebd280c85d41a1d33608132667de562e726b (diff) |
Catch right type of exception when decoding JSON
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'swiftstory/SwiftStory.py')
-rw-r--r-- | swiftstory/SwiftStory.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/swiftstory/SwiftStory.py b/swiftstory/SwiftStory.py index 2f5ae36..9e3051a 100644 --- a/swiftstory/SwiftStory.py +++ b/swiftstory/SwiftStory.py @@ -18,7 +18,7 @@ def client_left_handler(client, server): def message_received_handler(client, server, message): try: json_msg = json.loads(message) - except: + except JSONDecodeError: res = error('badly formatted json') else: op = json_msg['op'] |