Check if the response from Slack was successful. Returns: (SlackResponse) This method returns it's own object. e.g. 'self' Raises: SlackApiError: The request to the Slack API failed.
(self)
| 180 | return self.data.get(key, default) |
| 181 | |
| 182 | def validate(self): |
| 183 | """Check if the response from Slack was successful. |
| 184 | |
| 185 | Returns: |
| 186 | (SlackResponse) |
| 187 | This method returns it's own object. e.g. 'self' |
| 188 | |
| 189 | Raises: |
| 190 | SlackApiError: The request to the Slack API failed. |
| 191 | """ |
| 192 | if self.status_code == 200 and self.data and (isinstance(self.data, bytes) or self.data.get("ok", False)): |
| 193 | return self |
| 194 | msg = f"The request to the Slack API failed. (url: {self.api_url})" |
| 195 | raise e.SlackApiError(message=msg, response=self) |
no test coverage detected