Sha256: c2b7be94d06625f67946c6dbec984b7a8d37d72fdf5f86051d9a090172787fdf

Contents?: true

Size: 871 Bytes

Versions: 18

Compression:

Stored size: 871 Bytes

Contents

# We need to do this because of the way integration loading works
require "rack/timeout/base" unless defined?(Rack::Timeout)

# This integration is a good example of how to change how exceptions
# get grouped by Sentry's UI. Simply override #raven_context in
# the exception class, and append something to the fingerprint
# that will distinguish exceptions in the way you desire.
module RackTimeoutExtensions
  def raven_context
    # Only rack-timeout 0.3.0+ provides the request environment, but we can't
    # gate this based on a gem version constant because rack-timeout does
    # not provide one.
    { :fingerprint => ["{{ default }}", env["REQUEST_URI"]] } if defined?(env)
  end
end

# Include is private in Ruby 1.9
Rack::Timeout::Error.__send__(:include, RackTimeoutExtensions)
Rack::Timeout::RequestTimeoutException.__send__(:include, RackTimeoutExtensions)

Version data entries

18 entries across 18 versions & 3 rubygems

Version Path
sentry-raven-3.0.0 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.13.0 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.12.3 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.12.2 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.12.1 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.12.0 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.11.3 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.11.2 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.11.1 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.11.0 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.10.0 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.9.0 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.8.0 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.7.4 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.7.3 lib/raven/integrations/rack-timeout.rb
jones-gem-2.7.2 lib/raven/integrations/rack-timeout.rb
alec-gem-2.7.2 lib/raven/integrations/rack-timeout.rb
sentry-raven-2.7.2 lib/raven/integrations/rack-timeout.rb