Module: Sentry::Puma::Server

Defined in:
lib/sentry/puma.rb

Constant Summary collapse

PUMA_4_AND_PRIOR =
Gem::Version.new(::Puma::Const::PUMA_VERSION) < Gem::Version.new("5.0.0")

Instance Method Summary collapse

Instance Method Details

#lowlevel_error(e, env, status = 500) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/sentry/puma.rb', line 10

def lowlevel_error(e, env, status = 500)
  result =
    if PUMA_4_AND_PRIOR
      super(e, env)
    else
      super
    end

  begin
    Sentry.capture_exception(e) do |scope|
      scope.set_rack_env(env)
    end
  rescue
    # if anything happens, we don't want to break the app
  end

  result
end