Created
March 20, 2014 22:51
-
-
Save ryangreenberg/9675712 to your computer and use it in GitHub Desktop.
thrift_client wrapped exceptions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby -KU | |
require 'rubygems' | |
require 'thrift' | |
ex = Thrift::TransportException.new(Thrift::TransportException::NOT_OPEN, "it was not open") | |
wrapped_ex = begin | |
raise Thrift::TransportException, ex.message, ex.backtrace | |
rescue StandardError => e | |
e | |
end | |
puts "ex: #{(ex).inspect}" # => ex: #<Thrift::TransportException: it was not open> | |
puts "wrapped_ex: #{(wrapped_ex).inspect}" # => wrapped_ex: #<Thrift::TransportException: Thrift::TransportException> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment