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

Conversation

mikeurbanski1
Copy link

@mikeurbanski1 mikeurbanski1 commented May 4, 2020

This fixes two issues with how the Slack handler handles errors.

The first is a fix for the Exception message formatting, which resulted in a string concatenation error before, and the raised exception was actually this one, not the original exception. Now it uses string templates properly and raises the intended exception.

The second fix is to let any error with the UDF propagate up to the calling function, instead of returning None.

Before, catching this exception and returning None would result in alert_dispatcher thinking the handler completed successfully; it would set

result = {
  'success': True,
  'details': apply_some(handler_module.handle, **handler_kwargs),
}

where the return value of apply_some(...) was None.

This fix raises the exception up so that the result includes success: False and the exception that caused it.

Copy link
Collaborator

@sfc-gh-afedorov sfc-gh-afedorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, thank you kindly

@sfc-gh-afedorov sfc-gh-afedorov changed the base branch from master to v1.9.5 May 20, 2020 04:01
@sfc-gh-afedorov sfc-gh-afedorov merged commit 9f81b97 into snowflakedb:v1.9.5 May 20, 2020
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

Successfully merging this pull request may close these issues.

2 participants