move futures/ScheduledExecutor to executors/ScheduledExecutor
[folly.git] / folly / futures / Promise-inl.h
index 3c6ff17345965552b303bb943638fe0c046e0f4e..5fe4ed2cb029c782c39e3f54ac9fa2fdb0fc2222 100644 (file)
@@ -99,13 +99,7 @@ Promise<T>::setException(E const& e) {
 
 template <class T>
 void Promise<T>::setException(std::exception_ptr const& ep) {
-  try {
-    std::rethrow_exception(ep);
-  } catch (const std::exception& e) {
-    setException(exception_wrapper(std::current_exception(), e));
-  } catch (...) {
-    setException(exception_wrapper(std::current_exception()));
-  }
+  setException(exception_wrapper::from_exception_ptr(ep));
 }
 
 template <class T>