Class: ExceptionHunter::Middleware::RequestHunter

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

Overview

Rack Middleware used to rescue from exceptions track them and then re-raise them.

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.



19
20
21
# File 'lib/exception_hunter/middleware/request_hunter.rb', line 19

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



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

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