Skip to content

Commit

Permalink
fix: better slack error message (keephq#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl authored Jul 16, 2024
1 parent b16bb08 commit 103e7c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions keep/providers/slack_provider/slack_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def _notify(self, message="", blocks=[], channel="", **kwargs: dict):
},
)
if not message:
if not blocks:
raise ProviderException(
"Message is required - see for example https://github.com/keephq/keep/blob/main/examples/workflows/slack_basic.yml#L16"
)
message = blocks[0].get("text")
if self.authentication_config.webhook_url:
response = requests.post(
Expand Down

0 comments on commit 103e7c0

Please sign in to comment.