Thrift: Better exception handling in Ruby.
Reviewed By: mcslee
Test Plan: None.
Revert Plan: ok
Other Notes:
Submitted by William Morgan.
Approved by Kevin Clark.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665442 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/lib/thrift/server/tserver.rb b/lib/rb/lib/thrift/server/tserver.rb
index 6bfc1e0..0a213c7 100644
--- a/lib/rb/lib/thrift/server/tserver.rb
+++ b/lib/rb/lib/thrift/server/tserver.rb
@@ -41,10 +41,11 @@
while (true)
@processor.process(prot, prot)
end
- rescue TTransportException => ttx
+ rescue TTransportException, TProtocolException => ttx
print ttx,"\n"
+ ensure
+ trans.close()
end
- trans.close()
end
end