Commit 0fd2fc2f authored by David Detlefs's avatar David Detlefs Committed by Facebook GitHub Bot

Fix comment explaining how to use thenValue/thenError.

Summary: I thought that since I noticed it, and it tripped me up a bit, we might as well fix it.

Reviewed By: LeeHowes

Differential Revision: D26048767

fbshipit-source-id: 91ba9f834df411eb2d775691be4aec8a8d99776b
parent 88382fbf
......@@ -1505,12 +1505,12 @@ class Future : private futures::detail::FutureBase<T> {
/// Example:
///
/// makeFuture()
/// .thenValue([] {
/// .thenValue([](folly::Unit&&) {
/// throw std::runtime_error("oh no!");
/// return 42;
/// })
/// .thenError<std::runtime_error>([] (std::runtime_error& e) {
/// LOG(INFO) << "std::runtime_error: " << e.what();
/// .thenError([](folly::exception_wrapper&& e) {
/// LOG(INFO) << "std::runtime_error: " << e.get_exception()->what();
/// return -1; // or makeFuture<int>(-1)
/// });
///
......
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