Class: AdWords::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/adwords4r.rb

Overview

Error class to wrap several error types in Ruby objects

Defined Under Namespace

Classes: AccountError, ApiError, AuthError, BillingError, EnvironmentMismatchError, Error, GoogleInternalError, RequestError, UnknownAPICall, UnknownType, WebpageError

Class Method Summary collapse

Class Method Details

.create_specific_api_error(soap_fault) ⇒ Object

Creates a specific ApiError subclass, based on the provided SOAP fault.

Args:

  • soap_fault: the SOAP::FaultError on which to base this error

Returns: A new instance of the appropriate subclass of ApiError



341
342
343
344
345
346
347
348
# File 'lib/adwords4r.rb', line 341

def self.create_specific_api_error(soap_fault)
  error = @@api_errors[soap_fault.faultcode.text.to_i]
  if error.nil?
    return ApiError.new(soap_fault)
  else
    return eval("#{error}.new(soap_fault)")
  end
end