Exception: AdWords::Error::ApiError
- Defined in:
- lib/adwords4r.rb
Overview
Raised if a call returns with a SOAP error, gives you easy access to adwords error fields
Direct Known Subclasses
AccountError, BillingError, GoogleInternalError, RequestError, WebpageError
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#code_ex ⇒ Object
Returns the value of attribute code_ex.
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#field ⇒ Object
Returns the value of attribute field.
-
#index ⇒ Object
Returns the value of attribute index.
-
#inner_fault ⇒ Object
Returns the value of attribute inner_fault.
-
#internal ⇒ Object
Returns the value of attribute internal.
-
#isExemptable ⇒ Object
Returns the value of attribute isExemptable.
-
#message ⇒ Object
Returns the value of attribute message.
-
#soap_faultcode ⇒ Object
Returns the value of attribute soap_faultcode.
-
#soap_faultcode_ex ⇒ Object
Returns the value of attribute soap_faultcode_ex.
-
#soap_faultstring ⇒ Object
Returns the value of attribute soap_faultstring.
-
#soap_faultstring_ex ⇒ Object
Returns the value of attribute soap_faultstring_ex.
-
#textIndex ⇒ Object
Returns the value of attribute textIndex.
-
#textLength ⇒ Object
Returns the value of attribute textLength.
-
#top_code ⇒ Object
Returns the value of attribute top_code.
-
#trigger ⇒ Object
Returns the value of attribute trigger.
-
#trigger_ex ⇒ Object
The *_ex attributes have been added to correct deficiencies with the initial implementation.
Instance Method Summary collapse
-
#initialize(soap_fault) ⇒ ApiError
constructor
Constructor for ApiError.
Constructor Details
#initialize(soap_fault) ⇒ ApiError
Constructor for ApiError.
Args:
-
soap_fault: SOAP fault returned by the service.
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/adwords4r.rb', line 440 def initialize(soap_fault) @soap_faultcode = protect { soap_fault.faultcode } @soap_faultcode_ex = protect { soap_fault.faultcode.text } @soap_faultstring = protect { soap_fault.faultstring } @soap_faultstring_ex = protect { soap_fault.faultstring.text } @inner_fault = protect { soap_fault } if protect { soap_fault.detail and soap_fault.detail.fault } fault = soap_fault.detail.fault @top_code = protect { fault.code } @internal = protect { fault.internal } = protect { fault. } @trigger_ex = protect { fault.trigger } @code_ex = protect { fault.code } if protect { fault.errors and fault.errors.size > 0 } error = fault.errors.first @code = protect { error.code } @detail = protect { error.detail } @field = protect { error.field } @index = protect { error.index } @isExemptable = protect { error.isExemptable } @textIndex = protect { error.textIndex } @textLength = protect { error.textLength } @trigger = protect { error.trigger } end end end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
413 414 415 |
# File 'lib/adwords4r.rb', line 413 def code @code end |
#code_ex ⇒ Object
Returns the value of attribute code_ex.
431 432 433 |
# File 'lib/adwords4r.rb', line 431 def code_ex @code_ex end |
#detail ⇒ Object
Returns the value of attribute detail.
414 415 416 |
# File 'lib/adwords4r.rb', line 414 def detail @detail end |
#field ⇒ Object
Returns the value of attribute field.
415 416 417 |
# File 'lib/adwords4r.rb', line 415 def field @field end |
#index ⇒ Object
Returns the value of attribute index.
416 417 418 |
# File 'lib/adwords4r.rb', line 416 def index @index end |
#inner_fault ⇒ Object
Returns the value of attribute inner_fault.
433 434 435 |
# File 'lib/adwords4r.rb', line 433 def inner_fault @inner_fault end |
#internal ⇒ Object
Returns the value of attribute internal.
411 412 413 |
# File 'lib/adwords4r.rb', line 411 def internal @internal end |
#isExemptable ⇒ Object
Returns the value of attribute isExemptable.
417 418 419 |
# File 'lib/adwords4r.rb', line 417 def isExemptable @isExemptable end |
#message ⇒ Object
Returns the value of attribute message.
412 413 414 |
# File 'lib/adwords4r.rb', line 412 def end |
#soap_faultcode ⇒ Object
Returns the value of attribute soap_faultcode.
408 409 410 |
# File 'lib/adwords4r.rb', line 408 def soap_faultcode @soap_faultcode end |
#soap_faultcode_ex ⇒ Object
Returns the value of attribute soap_faultcode_ex.
429 430 431 |
# File 'lib/adwords4r.rb', line 429 def soap_faultcode_ex @soap_faultcode_ex end |
#soap_faultstring ⇒ Object
Returns the value of attribute soap_faultstring.
409 410 411 |
# File 'lib/adwords4r.rb', line 409 def soap_faultstring @soap_faultstring end |
#soap_faultstring_ex ⇒ Object
Returns the value of attribute soap_faultstring_ex.
430 431 432 |
# File 'lib/adwords4r.rb', line 430 def soap_faultstring_ex @soap_faultstring_ex end |
#textIndex ⇒ Object
Returns the value of attribute textIndex.
418 419 420 |
# File 'lib/adwords4r.rb', line 418 def textIndex @textIndex end |
#textLength ⇒ Object
Returns the value of attribute textLength.
419 420 421 |
# File 'lib/adwords4r.rb', line 419 def textLength @textLength end |
#top_code ⇒ Object
Returns the value of attribute top_code.
410 411 412 |
# File 'lib/adwords4r.rb', line 410 def top_code @top_code end |
#trigger ⇒ Object
Returns the value of attribute trigger.
420 421 422 |
# File 'lib/adwords4r.rb', line 420 def trigger @trigger end |
#trigger_ex ⇒ Object
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!
428 429 430 |
# File 'lib/adwords4r.rb', line 428 def trigger_ex @trigger_ex end |