Class: ExceptionHunter::Middleware::RequestHunter

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_hunter/middleware/request_hunter.rb

Constant Summary collapse

ENVIRONMENT_KEYS =
%w[PATH_INFO
QUERY_STRING
REMOTE_HOST
REQUEST_METHOD
REQUEST_URI
SERVER_PROTOCOL
HTTP_HOST
CONTENT_TYPE
HTTP_USER_AGENT].freeze
FILTERED_PARAMS =
[/password/].freeze

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RequestHunter

Returns a new instance of RequestHunter.



17
18
19
# File 'lib/exception_hunter/middleware/request_hunter.rb', line 17

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



21
22
23
24
25
26
# File 'lib/exception_hunter/middleware/request_hunter.rb', line 21

def call(env)
  @app.call(env)
rescue Exception => exception # rubocop:disable Lint/RescueException
  catch_prey(env, exception)
  raise exception
end