From 657712425278c595dca20618c46ab0e23175d166 Mon Sep 17 00:00:00 2001 From: Alex Rosenblatt Date: Mon, 12 Dec 2022 17:41:16 -0800 Subject: [PATCH] Update server.py with better error handling text Ran into a difficult to debug issue where I could not figure out why bot server could not find my file. Turns out the file had a syntax preventing it from being interpreted which then prevented it from being imported. However, the existing text did not provide enough information. This updates that text to help debug more easily. --- zulip_botserver/zulip_botserver/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zulip_botserver/zulip_botserver/server.py b/zulip_botserver/zulip_botserver/server.py index 17d051180..7a2e3151f 100644 --- a/zulip_botserver/zulip_botserver/server.py +++ b/zulip_botserver/zulip_botserver/server.py @@ -125,8 +125,8 @@ def load_lib_modules(available_bots: List[str]) -> Dict[str, ModuleType]: _, bots_lib_module[bot] = import_module_from_zulip_bot_registry(bot) if bots_lib_module[bot] is None: error_message = ( - f'Error: Bot "{bot}" doesn\'t exist. Please make sure ' - "you have set up the botserverrc file correctly.\n" + f'Error: Bot "{bot}" doesn\'t exist or the file cannot be imported. Please make sure ' + "you have set up the botserverrc file correctly and that the file runs without errors.\n" ) if bot == "api": error_message += (