Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/slack error handling #401

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/runners/handlers/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def message_template(vars):
payload = json.loads(''.join(row[0]))
else:
log.error(f"Error loading javascript template {vars['template']}")
raise Exception("Error loading javascript template " + {vars['template']})
raise Exception(f"Error loading javascript template {vars['template']}")
except Exception as e:
log.error(f"Error loading javascript template", e)
raise
Expand Down Expand Up @@ -105,10 +105,7 @@ def handle(
properties = {'channel': channel, 'message': message}

# create Slack message structure in Snowflake javascript UDF
try:
payload = message_template(locals())
except Exception:
return None
payload = message_template(locals())

if payload is not None:
if 'blocks' in payload:
Expand Down