From: David Reiss Date: Fri, 25 Jan 2008 20:12:26 +0000 (+0000) Subject: Thrift: Better exception handling in Ruby. X-Git-Tag: 0.2.0~1030 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=41911a516663fec077b4b5228fc66ddebc1aae47;p=common%2Fthrift.git 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 6bfc1e09..0a213c7c 100644 --- a/lib/rb/lib/thrift/server/tserver.rb +++ b/lib/rb/lib/thrift/server/tserver.rb @@ -41,10 +41,11 @@ class TSimpleServer < TServer 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