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.
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
# File 'lib/adwords4r.rb', line 405 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 } @message = 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.
378 379 380 |
# File 'lib/adwords4r.rb', line 378 def code @code end |
#code_ex ⇒ Object
Returns the value of attribute code_ex.
396 397 398 |
# File 'lib/adwords4r.rb', line 396 def code_ex @code_ex end |
#detail ⇒ Object
Returns the value of attribute detail.
379 380 381 |
# File 'lib/adwords4r.rb', line 379 def detail @detail end |
#field ⇒ Object
Returns the value of attribute field.
380 381 382 |
# File 'lib/adwords4r.rb', line 380 def field @field end |
#index ⇒ Object
Returns the value of attribute index.
381 382 383 |
# File 'lib/adwords4r.rb', line 381 def index @index end |
#inner_fault ⇒ Object
Returns the value of attribute inner_fault.
398 399 400 |
# File 'lib/adwords4r.rb', line 398 def inner_fault @inner_fault end |
#internal ⇒ Object
Returns the value of attribute internal.
376 377 378 |
# File 'lib/adwords4r.rb', line 376 def internal @internal end |
#isExemptable ⇒ Object
Returns the value of attribute isExemptable.
382 383 384 |
# File 'lib/adwords4r.rb', line 382 def isExemptable @isExemptable end |
#message ⇒ Object
Returns the value of attribute message.
377 378 379 |
# File 'lib/adwords4r.rb', line 377 def @message end |
#soap_faultcode ⇒ Object
Returns the value of attribute soap_faultcode.
373 374 375 |
# File 'lib/adwords4r.rb', line 373 def soap_faultcode @soap_faultcode end |
#soap_faultcode_ex ⇒ Object
Returns the value of attribute soap_faultcode_ex.
394 395 396 |
# File 'lib/adwords4r.rb', line 394 def soap_faultcode_ex @soap_faultcode_ex end |
#soap_faultstring ⇒ Object
Returns the value of attribute soap_faultstring.
374 375 376 |
# File 'lib/adwords4r.rb', line 374 def soap_faultstring @soap_faultstring end |
#soap_faultstring_ex ⇒ Object
Returns the value of attribute soap_faultstring_ex.
395 396 397 |
# File 'lib/adwords4r.rb', line 395 def soap_faultstring_ex @soap_faultstring_ex end |
#textIndex ⇒ Object
Returns the value of attribute textIndex.
383 384 385 |
# File 'lib/adwords4r.rb', line 383 def textIndex @textIndex end |
#textLength ⇒ Object
Returns the value of attribute textLength.
384 385 386 |
# File 'lib/adwords4r.rb', line 384 def textLength @textLength end |
#top_code ⇒ Object
Returns the value of attribute top_code.
375 376 377 |
# File 'lib/adwords4r.rb', line 375 def top_code @top_code end |
#trigger ⇒ Object
Returns the value of attribute trigger.
385 386 387 |
# File 'lib/adwords4r.rb', line 385 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!
393 394 395 |
# File 'lib/adwords4r.rb', line 393 def trigger_ex @trigger_ex end |