module AsyncIO::Rescuer

Public Instance Methods

rescuer() { || ... } click to toggle source

Rescues any sort of exception raised and log it to a default logger, returns :rescued if any exception was raised.

# File lib/async_io/rescuer.rb, line 9
def rescuer
  begin
    yield
  rescue Exception => notice
    AsyncIO::Logger.error("[-:AsyncIO::AsyncIO:-] - #{notice}\n")
    :rescued
  end
end