MCPcopy Index your code
hub / github.com/slackapi/python-slack-sdk / validate

Method validate

slack_sdk/web/slack_response.py:182–195  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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)

Callers 5

__next__Method · 0.95
_urllib_api_callMethod · 0.45
_sendMethod · 0.45
_sendMethod · 0.45
_urllib_api_callMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected