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

Allow customizing message for Slack notifications #229

Open
nawatts opened this issue May 18, 2020 · 0 comments
Open

Allow customizing message for Slack notifications #229

nawatts opened this issue May 18, 2020 · 0 comments

Comments

@nawatts
Copy link
Contributor

nawatts commented May 18, 2020

slack_notifications uses the process name from sys.argv in notifications.

process = os.path.basename(sys.argv[0])
try:
yield
slack_client = SlackClient(token)
slack_client.send_message(
to, f":white_check_mark: Success! {process} finished!"
)
except Exception as e:
slack_client = SlackClient(token)
slack_client.send_file(
to,
content=traceback.format_exc(),
filename=f"error_{process}_{time.strftime('%Y-%m-%d_%H:%M')}.log",
filetype="text",
comment=f":x: Error in {process}",
)

However, someone may want notifications about multiple blocks in the same script. There should be a way to distinguish those notifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant