我得到异常Thrift::TransportException (end of file reached)
,我想用消息(“到达文件结尾”)来拯救它。
现在我做
begin
#...
rescue Thrift::TransportException => e
raise e unless "end of file reached" == e.message
# do whatever if it is not end of file reached.
end
有什么方法可以做到这一点吗?