You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just want to handle errors gracefully. I note that #662 apparently cleaned up issues that people had been having in this area, but it doesn't seem to have allowed some kind of "raise on error" vs "return response". I just want to be able to look at the response and handle it myself. The error has some text in it, when I print it, but why can't I just get it myself.
An Aside: The problem I'm finding with this Slack API in general is an under-documentation. For example, blithely saying "get an API token", when in fact there is a huge step of doing this, you need to create an app profile, beg an admin (or easier, create your own slack), etc, etc.
eg:
response = client.conversations_history(channel=channel_id)
if response['error'] :
...
vs
try:
response = client.conversations_history(channel=channel_id)
except Exception as e:
print(....)
which gives:
Exception: The request to the Slack API failed. (url: https://www.slack.com/api/conversations.history)
The server responded with: {'ok': False, 'error': 'not_in_channel'}
The text was updated successfully, but these errors were encountered:
I just want to handle errors gracefully. I note that #662 apparently cleaned up issues that people had been having in this area, but it doesn't seem to have allowed some kind of "raise on error" vs "return response". I just want to be able to look at the response and handle it myself. The error has some text in it, when I print it, but why can't I just get it myself.
An Aside: The problem I'm finding with this Slack API in general is an under-documentation. For example, blithely saying "get an API token", when in fact there is a huge step of doing this, you need to create an app profile, beg an admin (or easier, create your own slack), etc, etc.
The text was updated successfully, but these errors were encountered: