Class: LogrageRailsRequestQueuing::ExceptionDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/lograge_rails_request_queuing/exception_details.rb

Class Method Summary collapse

Class Method Details

.add_any_exception!(event, log_custom_options) ⇒ Object

If the current request has an exception attached, add the exception details and backtrace to the logging custom options



5
6
7
8
9
10
11
# File 'lib/lograge_rails_request_queuing/exception_details.rb', line 5

def self.add_any_exception!(event, log_custom_options)
  if event.payload[:exception_object]
    log_custom_options[:exception] = event.payload[:exception]
    log_custom_options[:backtrace] = Array(event.payload[:exception_object].backtrace)
  end
  nil
end