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

add error handling for slack api #792

Conversation

abridgett
Copy link
Contributor

Checks API return code as per https://api.slack.com/web

rc = json.loads(sc.api_call(self.method, **self.params).decode('utf-8'))
if not rc['ok']:
raise AirflowException("Slack API call failed: ({})".format(rc['error']))
logging.error("Slack API call failed ({})".format(rc['error']))
Copy link
Member

Choose a reason for hiding this comment

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

this line would never be reached.

@abridgett abridgett force-pushed the feature/add_error_handling_to_slack_operator branch from b56a5ff to f785baf Compare December 21, 2015 16:18
@abridgett
Copy link
Contributor Author

doh! fixed. I've also rebased onto master due to he params -> api_params change. Hope that was the right thing to do!

bolkedebruin added a commit that referenced this pull request Mar 7, 2016
…slack_operator

add error handling for slack api
@bolkedebruin bolkedebruin merged commit 76b5c90 into apache:master Mar 7, 2016
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.

None yet

3 participants