module Honeybadger::Util::RequestHash

def self.extract_session(request)

def self.extract_session(request)
  request.session.to_hash
rescue => e
  # Rails raises ArgumentError when `config.secret_token` is missing, and
  # ActionDispatch::Session::SessionRestoreError when the session can't be
  # restored.
  { error: "Failed to access session data -- #{e}" }
end