Module | PhusionPassenger::ClassicRailsExtensions::AnalyticsLogging::ACRescueExtension
In: | lib/phusion_passenger/classic_rails_extensions/analytics_logging/ac_rescue_extension.rb

### Methods

rescue_action_with_passenger

### Protected Instance methods

rescue_action_with_passenger(exception)

[Source]

        # File lib/phusion_passenger/classic_rails_extensions/analytics_logging/ac_rescue_extension.rb, line 32
    32:         def rescue_action_with_passenger(exception)
    33:                 # When a controller action crashes, log the exception.
    34:                 # But ignore routing errors (404s and stuff).
    35:                 request.env["PASSENGER_ACTION_FAILED"] = true
    36:                 if !defined?(ActionController::RoutingError) || !exception.is_a?(ActionController::RoutingError)
    37:                         AnalyticsLogging.new_transaction_log(request.env, :exceptions) do |log|
    38:                                 request_txn_id = request.env[PASSENGER_TXN_ID]
    39:                                 message = exception.message
    40:                                 message = exception.to_s if message.empty?
    41:                                 message = [message].pack('m')
    42:                                 message.gsub!("\n", "")
    43:                                 backtrace_string = [exception.backtrace.join("\n")].pack('m')
    44:                                 backtrace_string.gsub!("\n", "")
    45:
    46:                                 log.message("Request transaction ID: #{request_txn_id}")
    47:                                 log.message("Message: #{message}")
    48:                                 log.message("Class: #{exception.class.name}")
    49:                                 log.message("Backtrace: #{backtrace_string}")
    50:                                 log.message("Controller action: #{controller_class_name}##{action_name}")
    51:                         end
    52:                 end
    53:                 rescue_action_without_passenger(exception)
    54:         end

[Validate]