Check if the response from Slack was successful. Returns: (AsyncSlackResponse) This method returns it's own object. e.g. 'self' Raises: SlackApiError: The request to the Slack API failed.
(self)
| 172 | return self.data.get(key, default) |
| 173 | |
| 174 | def validate(self): |
| 175 | """Check if the response from Slack was successful. |
| 176 | |
| 177 | Returns: |
| 178 | (AsyncSlackResponse) |
| 179 | This method returns it's own object. e.g. 'self' |
| 180 | |
| 181 | Raises: |
| 182 | SlackApiError: The request to the Slack API failed. |
| 183 | """ |
| 184 | if self.status_code == 200 and self.data and self.data.get("ok", False): |
| 185 | return self |
| 186 | msg = "The request to the Slack API failed." |
| 187 | raise e.SlackApiError(message=msg, response=self) |
no test coverage detected