diff --git a/zulip_bots/zulip_bots/lib.py b/zulip_bots/zulip_bots/lib.py index 482bf4d..875300e 100644 --- a/zulip_bots/zulip_bots/lib.py +++ b/zulip_bots/zulip_bots/lib.py @@ -140,7 +140,10 @@ class ExternalBotHandler(object): def send_message(self, message: (Dict[str, Any])) -> Dict[str, Any]: if not self._rate_limit.is_legal(): self._rate_limit.show_error_and_exit() - return self._client.send_message(message) + resp = self._client.send_message(message) + if resp.get('result') == 'error': + print("ERROR!: " + str(resp)) + return resp def send_reply(self, message: Dict[str, Any], response: str, widget_content: Optional[str]=None) -> Dict[str, Any]: if message['type'] == 'private': diff --git a/zulip_bots/zulip_bots/tests/test_lib.py b/zulip_bots/zulip_bots/tests/test_lib.py index 63ec939..f3c9c0f 100644 --- a/zulip_bots/zulip_bots/tests/test_lib.py +++ b/zulip_bots/zulip_bots/tests/test_lib.py @@ -32,7 +32,9 @@ class FakeClient: ) def send_message(self, message): - pass + return dict( + result='success', + ) class FakeBotHandler: def usage(self):