capture exception information when creating exception_wrapper
[folly.git] / folly / futures / test / PromiseTest.cpp
index 559391a259ed9e21cdd6f651311343dd273d8ae6..ff9cef9cdc117016de938ecb37796272189e0461 100644 (file)
@@ -92,6 +92,8 @@ TEST(Promise, setException) {
     auto f = p.getFuture();
     try {
       throw eggs;
+    } catch (const std::exception& e) {
+      p.setException(exception_wrapper(std::current_exception(), e));
     } catch (...) {
       p.setException(exception_wrapper(std::current_exception()));
     }