Exception: VirtualBox::COM::COMException
- Inherits:
-
Exception
- Object
- Exception
- VirtualBox::COM::COMException
- Defined in:
- lib/virtualbox/com/exceptions.rb
Direct Known Subclasses
FileErrorException, HostErrorException, InvalidArgException, InvalidObjectStateException, InvalidSessionStateException, InvalidVMStateException, NoInterfaceException, NotImplementedException, NotSupportedException, ObjectInUseException, ObjectNotFoundException, PDMException, SubsystemException, VMErrorException, XMLErrorException
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ COMException
constructor
A new instance of COMException.
Constructor Details
#initialize(data = {}) ⇒ COMException
Returns a new instance of COMException.
10 11 12 13 14 15 16 17 18 |
# File 'lib/virtualbox/com/exceptions.rb', line 10 def initialize(data={}) @data = case data when Hash then data when String then { :message => data } when Integer then { :code => data } else raise "don't know how to interprete exception parameter" end super("error in API call: 0x#{data[:code].to_s(16)}") end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/virtualbox/com/exceptions.rb', line 8 def data @data end |