Fix broken promise error in folly::retrying
authorYinghai Lu <yinghai@fb.com>
Fri, 12 May 2017 17:21:06 +0000 (10:21 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 12 May 2017 17:39:12 +0000 (10:39 -0700)
commit4762a35e70fb08622baed5d30157c99c215f4f15
treeb1bde7c89ffe2ad2aaf6796855cda6c1a33adf78
parentb8fb402e792558c3baed5386000e3f09d9f2350e
Fix broken promise error in folly::retrying

Summary: This diff shows an issue in `folly::retrying`. When the future generation function throws an exception and `folly::retrying` is nested in another functor that returns Future, it will throw `broken promise` instead of the actual exception message, which can be very generic and confusing. Fix is to capture the exception so that exact error message can be propagated up.

Reviewed By: yfeldblum

Differential Revision: D5050690

fbshipit-source-id: 5b9b24977788f60aa778bb8e9cdf4281ea9a0023
folly/futures/Future-inl.h
folly/futures/test/RetryingTest.cpp