Class: CLI::Kit::ErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/kit/error_handler.rb

Defined Under Namespace

Modules: NullExceptionReporter

Instance Method Summary collapse

Constructor Details

#initialize(log_file:, exception_reporter:) ⇒ ErrorHandler

Returns a new instance of ErrorHandler.



7
8
9
10
# File 'lib/cli/kit/error_handler.rb', line 7

def initialize(log_file:, exception_reporter:)
  @log_file = log_file
  @exception_reporter_or_proc = exception_reporter || NullExceptionReporter
end

Instance Method Details

#call(&block) ⇒ Object



18
19
20
21
# File 'lib/cli/kit/error_handler.rb', line 18

def call(&block)
  install!
  handle_abort(&block)
end