From 6e44f62f44847643a697e56f42dbec77b72a5581 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 29 Mar 2020 23:03:05 +0200 Subject: Catch right type of exception when decoding JSON Signed-off-by: Olivier Gayot --- swiftstory/SwiftStory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'] -- cgit v1.2.3