From: Carl Worth Date: Sat, 26 Sep 2020 05:02:45 +0000 (-0700) Subject: Restore handling of error events from Slack X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=eab9b231f34e26385d18426fe0656ef5fc94edeb;p=turbot Restore handling of error events from Slack This is better than what I had copied from the example a few commits ago because this properly logs through the python logging system, (so the error message will appear in the Apache log file). --- diff --git a/turbot.py b/turbot.py index 92921a2..6c0d8b9 100755 --- a/turbot.py +++ b/turbot.py @@ -14,5 +14,9 @@ slack_bot_token = os.environ['SLACK_BOT_TOKEN'] slack_events = SlackEventAdapter(slack_signing_secret, "/slack/events", app) slack_client = WebClient(slack_bot_token) +@slack_events.on("error") +def handle_error(error): + app.logger.error("Error from Slack: " + str(error)) + if __name__ == '__main__': app.run(debug=True)