lib/timber/integrations/rack/error_event.rb in timber-2.6.0.pre.beta1 vs lib/timber/integrations/rack/error_event.rb in timber-2.6.0.pre.beta2
- old
+ new
@@ -16,14 +16,11 @@
module Rack
# A Rack middleware that is reponsible for capturing exception and error events
# {Timber::Events::Error}.
class ErrorEvent < Middleware
# We determine this when the app loads to avoid the overhead on a per request basis.
- EXCEPTION_WRAPPER_TAKES_CLEANER = if Gem.loaded_specs["rails"]
- Gem.loaded_specs["rails"].version >= Gem::Version.new('5.0.0')
- else
- false
- end
+ EXCEPTION_WRAPPER_TAKES_CLEANER = defined?(::ActionDispatch::ExceptionWrapper) &&
+ !::ActionDispatch::ExceptionWrapper.instance_methods.include?(:env)
def call(env)
begin
status, headers, body = @app.call(env)
rescue Exception => exception
\ No newline at end of file