Method: Slack::Messenger::Util::HTTPClient#call

Defined in:
lib/slack-messenger/util/http_client.rb

#callObject

rubocop:disable Layout/IndentHeredoc



26
27
28
29
30
31
32
33
34
35
# File 'lib/slack-messenger/util/http_client.rb', line 26

def call
  http_obj.request(request_obj).tap do |response|
    unless response.is_a?(Net::HTTPSuccess)
      raise Slack::Messenger::APIError, "The slack API returned an error: \#{response.body} (HTTP Code \#{response.code})\nCheck the \"Handling Errors\" section on https://api.slack.com/incoming-webhooks for more information\n"
    end
  end
end