+
+ # Lograge adds exceptions not being rescued to event.payload, but we're
+ # catching all errors on ApplicationController so we look for backtraces
+ # elsewhere.
+ if !Thread.current[:backtrace].nil?
+ payload.merge!(
+ {
+ exception: Thread.current[:exception],
+ exception_backtrace: Thread.current[:backtrace],
+ }
+ )
+ Thread.current[:exception] = nil
+ Thread.current[:backtrace] = nil
+ end
+