Hide Forgot
Description of problem: Some exceptions thrown from the ruby-qpid client code violate the API definition for Exception in Ruby. http://ruby-doc.org/core/classes/Exception.html#M000683 Instead of a String, the message is an Array. This can cause a cascading failure in code that attempts to rescue an exception and uses the message in a context requiring a String. >> begin ?> send_a_message_that_thows_exception >> rescue => e >> puts "oops, a problem: " + e.message >> end TypeError: can't convert Array into String from (irb):54:in `+' from (irb):54 >> p e.message.class Array >> p e.class Qpid::Session::Exception >> p e.message [#<struct Struct::Qpid_Execution_exception error_code=403, command_id=#<Qpid::Serial:0x7fa4fc69fc78 @value=0>, class_code=0, command_code=0, field_index=0, description="unauthorized-access: someone cannot publish to some.topic with routing-key tmp.foo (qpid/broker/SemanticState.cpp:483)", error_info={}, st_type=execution_exception, id=#<Qpid::Serial:0x7fa4fc6aaba0 @value=0>>] Occurs within Session.sync ruby-qpid-0.7.946106-2.el6.x86_64 session.rb line 116-118: if error? raise Qpid::Session::Exception, @exceptions end
Created attachment 512290 [details] REplaces the array with a String and error count.
Attached is a patch the replaces the array with a string instance.