Exception: CloudflareAPIError
- Inherits:
-
StandardError
- Object
- StandardError
- CloudflareAPIError
- Defined in:
- lib/logstash/inputs/cloudflare.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
-
#success ⇒ Object
Returns the value of attribute success.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, response, content) ⇒ CloudflareAPIError
constructor
A new instance of CloudflareAPIError.
Constructor Details
#initialize(url, response, content) ⇒ CloudflareAPIError
Returns a new instance of CloudflareAPIError.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/logstash/inputs/cloudflare.rb', line 15 def initialize(url, response, content) begin json_data = JSON.parse(content) rescue JSON::ParserError json_data = {} end @url = url @success = json_data.fetch('success', false) @errors = json_data.fetch('errors', []) @status_code = response.code end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
11 12 13 |
# File 'lib/logstash/inputs/cloudflare.rb', line 11 def errors @errors end |
#status_code ⇒ Object
Returns the value of attribute status_code.
13 14 15 |
# File 'lib/logstash/inputs/cloudflare.rb', line 13 def status_code @status_code end |
#success ⇒ Object
Returns the value of attribute success.
12 13 14 |
# File 'lib/logstash/inputs/cloudflare.rb', line 12 def success @success end |
#url ⇒ Object
Returns the value of attribute url.
10 11 12 |
# File 'lib/logstash/inputs/cloudflare.rb', line 10 def url @url end |