Exception: EPPClient::EPPErrorResponse

Inherits:
StandardError
  • Object
show all
Defined in:
lib/epp-client/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ EPPErrorResponse

An exception with an added field so that it can store the xml response that generated it.



7
8
9
10
11
# File 'lib/epp-client/exceptions.rb', line 7

def initialize(attrs = {})
  @response_xml = attrs[:xml]
  @response_code = attrs[:code]
  @message = attrs[:message]
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



3
4
5
# File 'lib/epp-client/exceptions.rb', line 3

def message
  @message
end

#response_codeObject

Returns the value of attribute response_code.



3
4
5
# File 'lib/epp-client/exceptions.rb', line 3

def response_code
  @response_code
end

#response_xmlObject

Returns the value of attribute response_xml.



3
4
5
# File 'lib/epp-client/exceptions.rb', line 3

def response_xml
  @response_xml
end

Instance Method Details

#inspectObject

:nodoc:



17
18
19
# File 'lib/epp-client/exceptions.rb', line 17

def inspect #:nodoc:
  "#<#{self.class}: code: #{@response_code}, message: #{@message.inspect}, xml: #{@response_xml}>"
end

#to_sObject

:nodoc:



13
14
15
# File 'lib/epp-client/exceptions.rb', line 13

def to_s #:nodoc:
  "#{@message} (code #{@response_code})"
end