Module: V8::Error::Protect

Instance Method Summary collapse

Instance Method Details

#protectObject



95
96
97
98
99
100
101
# File 'lib/v8/error.rb', line 95

def protect
  yield
rescue Exception => e
  error = V8::C::Exception::Error(e.message)
  error.SetHiddenValue("rr::Cause", V8::C::External::New(e))
  V8::C::ThrowException(error)
end