lib/virtualbox/exceptions.rb in virtualbox-0.5.4 vs lib/virtualbox/exceptions.rb in virtualbox-0.6.0

- old
+ new

@@ -7,7 +7,31 @@ class CommandFailedException < Exception; end class ConfigurationException < Exception; end class InvalidRelationshipObjectException < Exception; end class NonSettableRelationshipException < Exception; end class ValidationFailedException < Exception; end + + class FFIException < Exception + attr_accessor :data + + def initialize(data={}) + @data = data + super("Error in API call to #{data[:function]}: #{data[:result_code]}") + end + end + + # FFI Exceptions, these exceptions are only raised on *nix machines + # when some error occurs in the foreign function interface. + class ObjectNotFoundException < FFIException; end + class InvalidVMStateException < FFIException; end + class VMErrorException < FFIException; end + class FileErrorException < FFIException; end + class SubsystemException < FFIException; end + class PDMException < FFIException; end + class InvalidObjectStateException < FFIException; end + class HostErrorException < FFIException; end + class NotSupportedException < FFIException; end + class XMLErrorException < FFIException; end + class InvalidSessionStateException < FFIException; end + class ObjectInUseException < FFIException; end end end \ No newline at end of file