Exception: BingAdsRubySdk::Errors::GeneralError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bing_ads_ruby_sdk/errors/errors.rb

Overview

Base exception class for reporting API errors

Direct Known Subclasses

ApplicationFault, ServerError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ GeneralError

Returns a new instance of GeneralError.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/bing_ads_ruby_sdk/errors/errors.rb', line 9

def initialize(response)
  @raw_response = response

  code = response[:error_code] || "Bing Ads API error"

  message = response[:message] ||
    response[:faultstring] ||
    "See exception details for more information."

  @message = format_message(code, message)
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



7
8
9
# File 'lib/bing_ads_ruby_sdk/errors/errors.rb', line 7

def message
  @message
end

#raw_responseObject

Returns the value of attribute raw_response.



7
8
9
# File 'lib/bing_ads_ruby_sdk/errors/errors.rb', line 7

def raw_response
  @raw_response
end