Exception: ZuoraAPI::Exceptions::ZuoraAPITemporaryError

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) ⇒ ZuoraAPITemporaryError

Returns a new instance of ZuoraAPITemporaryError.



197
198
199
200
201
202
203
# File 'lib/zuora_api/exceptions.rb', line 197

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 = "There is a temporary error with zuora system."
  @errors = errors
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



194
195
196
# File 'lib/zuora_api/exceptions.rb', line 194

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.



195
196
197
# File 'lib/zuora_api/exceptions.rb', line 195

def default_message=(value)
  @default_message = value
end

#errorsObject (readonly)

Returns the value of attribute errors.



194
195
196
# File 'lib/zuora_api/exceptions.rb', line 194

def errors
  @errors
end

#responseObject (readonly)

Returns the value of attribute response.



194
195
196
# File 'lib/zuora_api/exceptions.rb', line 194

def response
  @response
end

Instance Method Details

#to_sObject



205
206
207
# File 'lib/zuora_api/exceptions.rb', line 205

def to_s
  @message || @default_message
end