lib/rollbar/middleware/rails/show_exceptions.rb in rollbar-3.4.0 vs lib/rollbar/middleware/rails/show_exceptions.rb in rollbar-3.4.1

- old
+ new

@@ -2,21 +2,26 @@ module Middleware module Rails module ShowExceptions include ExceptionReporter - def render_exception_with_rollbar(env, exception) + def render_exception_with_rollbar(env, exception, wrapper = nil) key = 'action_dispatch.show_detailed_exceptions' if exception.is_a?(ActionController::RoutingError) && env[key] scope = extract_scope_from(env) Rollbar.scoped(scope) do report_exception_to_rollbar(env, exception) end end - render_exception_without_rollbar(env, exception) + # Rails 7.1 changes the method signature for render_exception. + if self.class.instance_method(:render_exception_without_rollbar).arity == 2 + render_exception_without_rollbar(env, exception) + else + render_exception_without_rollbar(env, exception, wrapper) + end end def call_with_rollbar(env) call_without_rollbar(env) rescue ActionController::RoutingError => e