Allow for folly::exception_wrapper in ClientReceiveState
[folly.git] / folly / ExceptionWrapper.h
index 89ef616f1566b9122e36ca9ee5abe323abca5565..a18ee1f01b702caacccb6ab97b0d59f98e0d4166 100644 (file)
@@ -121,6 +121,14 @@ class exception_wrapper {
 
   explicit operator bool() const { return get(); }
 
+  std::exception_ptr getExceptionPtr() const {
+    try {
+      throwException();
+    } catch (...) {
+      return std::current_exception();
+    }
+  }
+
  private:
   std::shared_ptr<std::exception> item_;
   void (*throwfn_)(std::exception*);