bots: Print send_message errors for dev debugging.

This commit is contained in:
Steve Howell 2018-05-24 10:56:48 +00:00 committed by showell
parent fcd39204a9
commit 93661db0d1
2 changed files with 7 additions and 2 deletions

View file

@ -140,7 +140,10 @@ class ExternalBotHandler(object):
def send_message(self, message: (Dict[str, Any])) -> Dict[str, Any]: def send_message(self, message: (Dict[str, Any])) -> Dict[str, Any]:
if not self._rate_limit.is_legal(): if not self._rate_limit.is_legal():
self._rate_limit.show_error_and_exit() 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]: def send_reply(self, message: Dict[str, Any], response: str, widget_content: Optional[str]=None) -> Dict[str, Any]:
if message['type'] == 'private': if message['type'] == 'private':

View file

@ -32,7 +32,9 @@ class FakeClient:
) )
def send_message(self, message): def send_message(self, message):
pass return dict(
result='success',
)
class FakeBotHandler: class FakeBotHandler:
def usage(self): def usage(self):