Exception: Dingding::Notifier::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/dingding-notifier/util/http_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIError

Returns a new instance of APIError.



13
14
15
# File 'lib/dingding-notifier/util/http_client.rb', line 13

def initialize(response)
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



11
12
13
# File 'lib/dingding-notifier/util/http_client.rb', line 11

def response
  @response
end

Instance Method Details

#messageObject



17
18
19
20
21
22
# File 'lib/dingding-notifier/util/http_client.rb', line 17

def message
  <<-MSG
The slack API returned an error: #{@response.body} (HTTP Code #{@response.code})
Check the "Handling Errors" section on https://api.slack.com/incoming-webhooks for more information
MSG
end