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



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/makara/error_handler.rb', line 9

def handle(connection)
  yield

rescue Exception => e

  if e.is_a?(Makara::Errors::MakaraError)
    harshly(e)
  else
    gracefully(connection, e)
  end

end