From eab9b231f34e26385d18426fe0656ef5fc94edeb Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Fri, 25 Sep 2020 22:02:45 -0700 Subject: [PATCH] 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). --- turbot.py | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.45.2