Class: VCloudSdk::Xml::Error

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/cloud/vcloud/xml/wrapper_classes/error_wrapper.rb

Instance Method Summary collapse

Methods inherited from Wrapper

#==, #[], #[]=, #add_child, #attribute_with_ns, #content, #content=, #create_child, #create_qualified_name, #create_xpath_query, #doc_namespaces, #error, #get_nodes, #href, #href_id, #initialize, #name, #name=, #to_s, #type, #urn, #xpath

Constructor Details

This class inherits a constructor from VCloudSdk::Xml::Wrapper

Instance Method Details

#error_msgObject



15
16
17
# File 'lib/cloud/vcloud/xml/wrapper_classes/error_wrapper.rb', line 15

def error_msg
  @root["message"]
end

#exception(e) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/cloud/vcloud/xml/wrapper_classes/error_wrapper.rb', line 19

def exception(e)
  if error_msg.include? "There is already a VM named" and major_error == "400"
    raise VCloudCloud::ObjectExistsError
  else
    raise e
  end
end

#major_errorObject



7
8
9
# File 'lib/cloud/vcloud/xml/wrapper_classes/error_wrapper.rb', line 7

def major_error
  @root["majorErrorCode"]
end

#minor_errorObject



11
12
13
# File 'lib/cloud/vcloud/xml/wrapper_classes/error_wrapper.rb', line 11

def minor_error
  @root["minorErrorCode"]
end