Exception: BingAdsApi::ApiException

Inherits:
Exception
  • Object
show all
Defined in:
lib/bing-ads-api/api_exception.rb

Overview

Public : Generic exception thrown by service classes in BingAdsApi.

Exception of this kind wrap an AdApiFaultDetail or ApiFaultDetail instance
to look over the specific details of the SOAP request fault.
Author

[email protected]

Example

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fault_object, msg = nil) ⇒ ApiException

Public : Constructor. Based on the default Exception constructor, adds the fault_object instance, that can be an ApiFaultDetail or AdApiFaultDetail instance

Parameters

  • fault_object - AdApiFaultDetail or ApiFaultDetail instance

  • msg - optional message

Author

[email protected]



29
30
31
32
# File 'lib/bing-ads-api/api_exception.rb', line 29

def initialize(fault_object, msg=nil)
	super(msg)
	self.fault_object = fault_object
end

Instance Attribute Details

#fault_objectObject

Returns the value of attribute fault_object.



18
19
20
# File 'lib/bing-ads-api/api_exception.rb', line 18

def fault_object
  @fault_object
end

Instance Method Details

#to_sObject

Public : Specified to string method

Author

[email protected]



38
39
40
# File 'lib/bing-ads-api/api_exception.rb', line 38

def to_s
	super.to_s + " - " + fault_object.to_s
end