Issue Description
Observed that an exception thrown by an unrelated SDK was blowing up on our Sentry reporting. Narrowed down to this line exploding:
|
stacktrace.frames.last.vars = locals |
when the backtrace is [] (but not on nil)
Reproduction Steps
begin
raise StandardError, 'Stuff', []
rescue => e
Sentry.capture_exception(e)
end
Expected Behavior
It does not blow up.
Actual Behavior
(XXXX):13:in '<main>': undefined method 'vars=' for nil (NoMethodError)
stacktrace.frames.last.vars = locals
^^^^^^^
/app/vendor/bundle/ruby/3.4.0/gems/irb-1.15.1/lib/irb.rb:406:in 'full_message': Stuff (StandardError)
backtrace (trimmed for relevance):
["/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry/interfaces/single_exception.rb:63:in 'Sentry::SingleExceptionInterface.build_with_stacktrace'",
"/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry/interfaces/exception.rb:36:in 'block in Sentry::ExceptionInterface.build'",
"/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry/interfaces/exception.rb:33:in 'Array#map'",
"/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry/interfaces/exception.rb:33:in 'Sentry::ExceptionInterface.build'",
"/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry/error_event.rb:35:in 'Sentry::ErrorEvent#add_exception_interface'",
"/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry/client.rb:133:in 'block in Sentry::Client#event_from_exception'",
"<internal:kernel>:91:in 'Kernel#tap'",
"/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry/client.rb:132:in 'Sentry::Client#event_from_exception'",
"/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry/hub.rb:169:in 'Sentry::Hub#capture_exception'",
"/app/vendor/bundle/ruby/3.4.0/gems/sentry-ruby-6.1.0/lib/sentry-ruby.rb:427:in 'Sentry.capture_exception'",
"(ampledash):4:in '<main>'",
"/app/vendor/bundle/ruby/3.4.0/gems/irb-1.15.1/lib/irb/workspace.rb:101:in 'Kernel#eval'",
<SNIP>
"bin/rails:16:in '<main>'"]
Ruby Version
3.4
SDK Version
6.1.0
Integration and Its Version
Ruby
Sentry Config
(does not seem relevant)
Issue Description
Observed that an exception thrown by an unrelated SDK was blowing up on our Sentry reporting. Narrowed down to this line exploding:
sentry-ruby/sentry-ruby/lib/sentry/interfaces/single_exception.rb
Line 63 in 6c0ac11
when the backtrace is
[](but not onnil)Reproduction Steps
Expected Behavior
It does not blow up.
Actual Behavior
backtrace (trimmed for relevance):
Ruby Version
3.4
SDK Version
6.1.0
Integration and Its Version
Ruby
Sentry Config
(does not seem relevant)