Exception: ZuoraAPI::Exceptions::ZuoraAPISessionError
- Defined in:
- lib/zuora_api/exceptions.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#default_message ⇒ Object
writeonly
Sets the attribute default_message.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(message = nil, response = nil, errors = [], successes = []) ⇒ ZuoraAPISessionError
constructor
A new instance of ZuoraAPISessionError.
- #parse_message(message) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(message = nil, response = nil, errors = [], successes = []) ⇒ ZuoraAPISessionError
Returns a new instance of ZuoraAPISessionError.
33 34 35 36 37 38 |
# File 'lib/zuora_api/exceptions.rb', line 33 def initialize( = nil,response=nil, errors = [], successes = []) @code = response.class.to_s == "HTTParty::Response" ? response.code : nil @message = () @response = response @default_message = "Error with Zuora Session." end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
30 31 32 |
# File 'lib/zuora_api/exceptions.rb', line 30 def code @code end |
#default_message=(value) ⇒ Object (writeonly)
Sets the attribute default_message
31 32 33 |
# File 'lib/zuora_api/exceptions.rb', line 31 def (value) @default_message = value end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
30 31 32 |
# File 'lib/zuora_api/exceptions.rb', line 30 def response @response end |
Instance Method Details
#parse_message(message) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/zuora_api/exceptions.rb', line 44 def () case when /^Invalid Oauth Client Id$/, /^Unable to generate token.$/ @message = "Invalid login, please check client ID and Client Secret or URL endpoint" when /^Forbidden$/ @message = "The user associated to OAuth credential set has been deactivated." when /^Invalid login. User name and password do not match.$/ @message = "Invalid login, please check username and password or URL endpoint" else @message = end end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/zuora_api/exceptions.rb', line 40 def to_s @message || @default_message end |