Raised if a call returns with a SOAP error, gives you easy access to adwords error fields

Methods
N
Attributes
[RW] soap_faultcode
[RW] soap_faultstring
[RW] top_code
[RW] internal
[RW] message
[RW] code
[RW] detail
[RW] field
[RW] index
[RW] isExemptable
[RW] textIndex
[RW] textLength
[RW] trigger
[RW] trigger_ex

The *_ex attributes have been added to correct deficiencies with the initial implementation. They should expose more useful information (i.e. text of errors instead of a SOAP element) and proper mapping of a fault’s trigger and code. The old attributes are left behind for backward compatibility; hopefully this isn’t too confusing!

[RW] soap_faultcode_ex
[RW] soap_faultstring_ex
[RW] code_ex
[RW] inner_fault
Class Public methods
new(soap_fault)

Constructor for ApiError.

Args:

  • soap_fault: SOAP fault returned by the service.

     # File lib/adwords4r.rb, line 371
371:       def initialize(soap_fault)
372:         @soap_faultcode = protect { soap_fault.faultcode }
373:         @soap_faultcode_ex = protect { soap_fault.faultcode.text }
374:         @soap_faultstring = protect { soap_fault.faultstring }
375:         @soap_faultstring_ex = protect { soap_fault.faultstring.text }
376:         @inner_fault = protect { soap_fault }
377:         if protect { soap_fault.detail and soap_fault.detail.fault }
378:           fault = soap_fault.detail.fault
379:           @top_code = protect { fault.code }
380:           @internal = protect { fault.internal }
381:           @message = protect { fault.message }
382:           @trigger_ex = protect { fault.trigger }
383:           @code_ex = protect { fault.code }
384:           if protect { fault.errors and fault.errors.size > 0 }
385:             error = fault.errors.first
386:             @code = protect { error.code }
387:             @detail = protect { error.detail }
388:             @field = protect { error.field }
389:             @index = protect { error.index }
390:             @isExemptable = protect { error.isExemptable }
391:             @textIndex = protect { error.textIndex }
392:             @textLength = protect { error.textLength }
393:             @trigger = protect { error.trigger }
394:           end
395:         end
396:       end