Tests for handling of downstream errors

diff --git a/CHANGELOG b/CHANGELOG
index 4db1cd7..f39bc61 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,7 @@
 Unreleased
 
+  - FIX: No longer handles exceptions raised in downstream middleware via `on_middleware_error`
+
 28-01-2019
 
 - Version 2.2.0
diff --git a/spec/lib/message_bus/rack/middleware_spec.rb b/spec/lib/message_bus/rack/middleware_spec.rb
index e165566..744649b 100644
--- a/spec/lib/message_bus/rack/middleware_spec.rb
+++ b/spec/lib/message_bus/rack/middleware_spec.rb
@@ -369,6 +369,17 @@ describe MessageBus::Rack::Middleware do
 
         last_response.status.must_equal 407
       end
+
+      it "does not handle exceptions from downstream middleware" do
+        @bus.on_middleware_error do |_env, err|
+          [404, {}, []]
+        end
+
+        get("/")
+
+        last_response.status.must_equal 500
+        last_response.body.must_equal 'should not be called'
+      end
     end
 
     describe "messagebus.channels env support" do

GitHub sha: 42faf7b9

1 Like