Module: Flucti::Utilities::ConnectionErrorHandling

Defined in:
lib/flucti/utilities/connection_error_handling.rb

Defined Under Namespace

Modules: Handler

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(target) ⇒ Object



4
5
6
7
8
# File 'lib/flucti/utilities/connection_error_handling.rb', line 4

def self.included(target)
  target.module_eval do
    alias_method_chain :request, 'exception_handling'
  end
end

Instance Method Details

#request_with_exception_handling(*args, &block) ⇒ Object



10
11
12
13
14
# File 'lib/flucti/utilities/connection_error_handling.rb', line 10

def request_with_exception_handling(*args, &block)
  request_without_exception_handling(*args, &block)
rescue => e
  Handler.handle(e) or raise e
end