diff --git a/lib/twingly/amqp/subscription.rb b/lib/twingly/amqp/subscription.rb index 2322de8..bc0f41e 100644 --- a/lib/twingly/amqp/subscription.rb +++ b/lib/twingly/amqp/subscription.rb @@ -34,7 +34,7 @@ def initialize(queue_name:, exchange_topic: nil, routing_key: nil, @before_handle_message_callback = proc {} @on_exception_callback = proc {} - @on_error_callback = proc { raise "Channel closed unexpectedly" } + @on_error_callback = proc {} end def each_message(blocking: true, &block) diff --git a/spec/integration/twingly/amqp/subscription_spec.rb b/spec/integration/twingly/amqp/subscription_spec.rb index 1b3f845..3f61723 100644 --- a/spec/integration/twingly/amqp/subscription_spec.rb +++ b/spec/integration/twingly/amqp/subscription_spec.rb @@ -297,14 +297,6 @@ def simulate_channel_error(channel) simulate_channel_error(subject.raw_queue.channel) end.to yield_with_args(subject.raw_queue.channel, be_kind_of(AMQ::Protocol::Channel::Close)) end - - context "when no error callback is configured" do - it "should raise a default error" do - expect do - simulate_channel_error(subject.raw_queue.channel) - end.to raise_error(RuntimeError, "Channel closed unexpectedly") - end - end end context "without exchange_topic and routing_key" do