Skip to content

Commit dfc1f9a

Browse files
author
Marcus Cobden
committed
Fix 'No error message' errors
1 parent 8a911cb commit dfc1f9a

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

lib/vSphere/action/clone.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def call(env)
2222
dc = get_datacenter connection, machine
2323
template = dc.find_vm config.template_name
2424

25-
raise Error::VSphereError, :message => I18n.t('vsphere.errors.missing_template') if template.nil?
25+
raise Errors::VSphereError, :'missing_template' if template.nil?
2626

2727
begin
2828
location = get_location connection, machine, config, template
@@ -36,6 +36,8 @@ def call(env)
3636
env[:ui].info " -- Name: #{name}"
3737

3838
new_vm = template.CloneVM_Task(:folder => template.parent, :name => name, :spec => spec).wait_for_completion
39+
rescue Errors::VSphereError => e
40+
raise
3941
rescue Exception => e
4042
puts e.message
4143
raise Errors::VSphereError, :message => e.message

lib/vSphere/action/close_vsphere.rb

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ def call(env)
1212
begin
1313
env[:vSphere_connection].close
1414
@app.call env
15+
rescue Errors::VSphereError => e
16+
raise
1517
rescue Exception => e
1618
puts e
1719
#raise a properly namespaced error for Vagrant

lib/vSphere/action/connect_vsphere.rb

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def call(env)
1717
insecure: config.insecure, proxyHost: config.proxy_host,
1818
proxyPort: config.proxy_port
1919
@app.call env
20+
rescue VSphere::Errors::VSphereError => e
21+
raise
2022
rescue Exception => e
2123
puts e.backtrace
2224
raise VagrantPlugins::VSphere::Errors::VSphereError, :message => e.message

lib/vSphere/action/destroy.rb

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def destroy_vm(env)
2828
begin
2929
env[:ui].info I18n.t('vsphere.destroy_vm')
3030
vm.Destroy_Task.wait_for_completion
31+
rescue Errors::VSphereError => e
32+
raise
3133
rescue Exception => e
3234
raise Errors::VSphereError, :message => e.message
3335
end

0 commit comments

Comments
 (0)