Exception: XenAPI::Failure
- Inherits:
-
Exception
- Object
- Exception
- XenAPI::Failure
- Defined in:
- lib/xencap/xenapi.rb
Instance Attribute Summary collapse
-
#error_details ⇒ Object
readonly
Returns the value of attribute error_details.
-
#error_type ⇒ Object
readonly
Returns the value of attribute error_type.
Instance Method Summary collapse
-
#initialize(details = []) ⇒ Failure
constructor
A new instance of Failure.
- #to_s ⇒ Object
Constructor Details
#initialize(details = []) ⇒ Failure
Returns a new instance of Failure.
48 49 50 51 52 53 54 55 |
# File 'lib/xencap/xenapi.rb', line 48 def initialize(details = []) if details.is_a? Array @error_type = details[0] @error_details = details[1..-1] || [] else @error_details = [] end end |
Instance Attribute Details
#error_details ⇒ Object (readonly)
Returns the value of attribute error_details.
67 68 69 |
# File 'lib/xencap/xenapi.rb', line 67 def error_details @error_details end |
#error_type ⇒ Object (readonly)
Returns the value of attribute error_type.
67 68 69 |
# File 'lib/xencap/xenapi.rb', line 67 def error_type @error_type end |
Instance Method Details
#to_s ⇒ Object
57 58 59 60 61 62 63 64 65 |
# File 'lib/xencap/xenapi.rb', line 57 def to_s details = case @error_details.length when 0 then "" when 1 then @error_details[0] else @error_details.inspect end "#{@error_type.to_s}: #{details}" end |