Class: Makara::ErrorHandler

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

Instance Method Summary collapse

Instance Method Details

#handle(connection) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/makara/error_handler.rb', line 7

def handle(connection)
  yield
rescue Exception => e
  if e.is_a?(Makara::Errors::MakaraError)
    harshly(e)
  else
    gracefully(connection, e)
  end
end