Class: ProxyTester::Actions::HandleError

Inherits:
Object
  • Object
show all
Defined in:
lib/proxy_tester/handle_error.rb,
lib/proxy_tester/actions/handle_error.rb

Instance Method Summary collapse

Constructor Details

#initialize(exception, handler_klass = ErrorHandler) ⇒ HandleError

Returns a new instance of HandleError.



12
13
14
15
16
# File 'lib/proxy_tester/handle_error.rb', line 12

def initialize(exception, handler_klass = ErrorHandler)
  @exception        = exception.class
  @original_message = exception.message
  @handler_klass    = handler_klass
end

Instance Method Details

#runObject



18
19
20
21
22
23
# File 'lib/proxy_tester/handle_error.rb', line 18

def run
  handler = handler_klass.find exception
  handler.original_message = original_message

  handler.execute(parsed_message)
end