From e638cdd4a95d0471ae9c3fd5b7cdabeec8127673 Mon Sep 17 00:00:00 2001 From: Rhea Parekh Date: Mon, 4 Jun 2018 16:19:50 +0530 Subject: [PATCH] bots: Add proper error handling for trivia bot. --- zulip_bots/zulip_bots/bots/trivia_quiz/trivia_quiz.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zulip_bots/zulip_bots/bots/trivia_quiz/trivia_quiz.py b/zulip_bots/zulip_bots/bots/trivia_quiz/trivia_quiz.py index 0baf039..249070c 100644 --- a/zulip_bots/zulip_bots/bots/trivia_quiz/trivia_quiz.py +++ b/zulip_bots/zulip_bots/bots/trivia_quiz/trivia_quiz.py @@ -134,6 +134,8 @@ def generate_quiz_id(storage) -> str: quiz_num = storage.get('quiz_id') except KeyError: quiz_num = 0 + except TypeError: + quiz_num = 0 quiz_num += 1 quiz_num = quiz_num % (1000) storage.put('quiz_id', quiz_num)