# CREDIT David Heinemeier Hansson

module Kernel

  # Supress errors while executing a block,
  # with execptions.

  def suppress(*exception_classes)
    begin yield
    rescue Exception => e
      raise unless exception_classes.any? { |cls| e.kind_of?(cls) }
    end
  end

end
