Exception: XEClient::Error
- Inherits:
-
StandardError
- Object
- StandardError
- XEClient::Error
- Defined in:
- lib/xe_client/errors/error.rb
Direct Known Subclasses
Constant Summary collapse
- CODE_ERROR_MAP =
{ 1 => "AuthenticationError", }
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
Class Method Summary collapse
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
7 8 9 |
# File 'lib/xe_client/errors/error.rb', line 7 def code @code end |
Class Method Details
.new_from_response(response) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/xe_client/errors/error.rb', line 9 def self.new_from_response(response) return nil if response.code.nil? klass = if class_name = CODE_ERROR_MAP[response.code] XEClient.const_get(class_name) else self end error = klass.new(response.) error.code = response.code error end |