From 3f653ebe55bdce6745e99a3df91489a6fcaea5a0 Mon Sep 17 00:00:00 2001 From: Hannes Roth Date: Thu, 12 Feb 2015 10:27:33 -0800 Subject: [PATCH] (Wangle) Catch all exceptions in `then() -> Future` Summary: Saw this while debugging some stuff. Just an oversight, right? Test Plan: Ran all the tests. Reviewed By: hans@fb.com Subscribers: folly-diffs@, jsedgwick, yfeldblum FB internal diff: D1843016 Signature: t1:1843016:1423704557:d9fdb4b879ab4fcfda54a5fcb16a639df15872b5 --- folly/futures/Future-inl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index a6f35c26..77ff9fa9 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -192,6 +192,8 @@ Future::thenImplementation(F func, detail::argResult) { p->fulfilTry(std::move(b)); }); } catch (const std::exception& e) { + p->setException(exception_wrapper(std::current_exception(), e)); + } catch (...) { p->setException(exception_wrapper(std::current_exception())); } } -- 2.34.1