Exception: ZuoraAPI::Exceptions::ZuoraAPIError

Inherits:
Error
  • Object
show all
Defined in:
lib/zuora_api/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Error

#parse_message

Constructor Details

#initialize(message = nil, response = nil, errors = [], successes = [], *args) ⇒ ZuoraAPIError

Returns a new instance of ZuoraAPIError.



80
81
82
83
84
85
86
87
# File 'lib/zuora_api/exceptions.rb', line 80

def initialize(message = nil,response=nil, errors = [], successes = [],  *args)
  @code = response.class.to_s == "HTTParty::Response" ? response.code : nil
  @message = parse_message(message)
  @response = response
  @default_message = "Error communicating with Zuora."
  @errors = errors
  @successes = successes
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



77
78
79
# File 'lib/zuora_api/exceptions.rb', line 77

def code
  @code
end

#default_message=(value) ⇒ Object (writeonly)

Sets the attribute default_message

Parameters:

  • value

    the value to set the attribute default_message to.



78
79
80
# File 'lib/zuora_api/exceptions.rb', line 78

def default_message=(value)
  @default_message = value
end

#errorsObject (readonly)

Returns the value of attribute errors.



77
78
79
# File 'lib/zuora_api/exceptions.rb', line 77

def errors
  @errors
end

#responseObject (readonly)

Returns the value of attribute response.



77
78
79
# File 'lib/zuora_api/exceptions.rb', line 77

def response
  @response
end

#successesObject (readonly)

Returns the value of attribute successes.



77
78
79
# File 'lib/zuora_api/exceptions.rb', line 77

def successes
  @successes
end

Instance Method Details

#to_sObject



89
90
91
# File 'lib/zuora_api/exceptions.rb', line 89

def to_s
  @message || @default_message
end