Skip to content

Commit

Permalink
Merge pull request #74 from mkuzmin/rbvmomi-error-messages
Browse files Browse the repository at this point in the history
Fixed "No error message" on rbvmomi method calls.
  • Loading branch information
flamingbear committed Jul 3, 2014
2 parents d25b672 + c384b1c commit 51cf9e4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions lib/vSphere/action/clone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def call(env)
rescue Errors::VSphereError => e
raise
rescue Exception => e
puts e.message
raise Errors::VSphereError, :message => e.message
raise Errors::VSphereError.new, e.message
end

#TODO: handle interrupted status in the environment, should the vm be destroyed?
Expand Down
4 changes: 1 addition & 3 deletions lib/vSphere/action/close_vsphere.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ def call(env)
rescue Errors::VSphereError => e
raise
rescue Exception => e
puts e
#raise a properly namespaced error for Vagrant
raise Errors::VSphereError, :message => e.message
raise Errors::VSphereError.new, e.message
end
end
end
Expand Down
5 changes: 2 additions & 3 deletions lib/vSphere/action/connect_vsphere.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ def call(env)
insecure: config.insecure, proxyHost: config.proxy_host,
proxyPort: config.proxy_port
@app.call env
rescue VSphere::Errors::VSphereError => e
rescue Errors::VSphereError => e
raise
rescue Exception => e
puts e.backtrace
raise VagrantPlugins::VSphere::Errors::VSphereError, :message => e.message
raise Errors::VSphereError.new, e.message
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vSphere/action/destroy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def destroy_vm(env)
rescue Errors::VSphereError => e
raise
rescue Exception => e
raise Errors::VSphereError, :message => e.message
raise Errors::VSphereError.new, e.message
end
end
end
Expand Down

0 comments on commit 51cf9e4

Please sign in to comment.