module V8::Error::Try

def try

def try
  context = V8::Context.current
  V8::C::TryCatch() do |trycatch|
    result = yield
    if trycatch.HasCaught()
      V8::Error(trycatch.Exception())
    else
      result
    end
  end
end