Commit 2833ce1b authored by Marc Celani's avatar Marc Celani Committed by Dave Watson

Allow for folly::exception_wrapper in ClientReceiveState

Summary:
This diff allows us to use folly::exception_wrapper in ClientReceiveState. Existing use cases are still supported (crs.exception() still returns an exception_ptr no matter what), but we can now choose to set an exception without throwing first.

On the folly side, add some new functions for making an exception_ptr from an exception_wrapper.

Test Plan: Reran unit tests

Reviewed By: davejwatson@fb.com

FB internal diff: D1307027

@override-unit-failures
parent be60435f
......@@ -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*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment