Permalink
Browse files

fix ruby_vim_sdk bug

  • Loading branch information...
1 parent 941c260 commit 301b170d36c71eb83319262617580643d4fb518a Vadim Spivak committed Mar 30, 2011
Showing with 9 additions and 14 deletions.
  1. +9 −14 ruby_vim_sdk/lib/ruby_vim_sdk/soap/stub_adapter.rb
View
23 ruby_vim_sdk/lib/ruby_vim_sdk/soap/stub_adapter.rb
@@ -30,20 +30,15 @@ def invoke_method(managed_object, method_info, arguments, outer_stub = nil)
status = response.code
if status == 200 || status == 500
- begin
- object = SoapResponseDeserializer.new(outer_stub).deserialize(response.content, method_info.result_type)
- if outer_stub != self
- result = [status, object]
- elsif status == 200
- result = object
- elsif object.kind_of?(Vmodl::MethodFault)
- raise SoapException.new(object.msg, object)
- else
- raise SoapException.new("Unknown SOAP fault", object)
- end
- rescue Exception
- @connection_pool.close_connections
- raise
+ object = SoapResponseDeserializer.new(outer_stub).deserialize(response.content, method_info.result_type)
+ if outer_stub != self
+ result = [status, object]
+ elsif status == 200
+ result = object
+ elsif object.kind_of?(Vmodl::MethodFault)
+ raise SoapException.new(object.msg, object)
+ else
+ raise SoapException.new("Unknown SOAP fault", object)
end
else
raise Net::HTTPError.new("#{status}", nil)

0 comments on commit 301b170

Please sign in to comment.