X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Ffutures%2FPromise-inl.h;h=5fe4ed2cb029c782c39e3f54ac9fa2fdb0fc2222;hb=dbf0c41058bf6f45ed016856515700842ae73f1a;hp=3c6ff17345965552b303bb943638fe0c046e0f4e;hpb=063b4a3d63f502ea716704321e6a9462686ccdbb;p=folly.git diff --git a/folly/futures/Promise-inl.h b/folly/futures/Promise-inl.h index 3c6ff173..5fe4ed2c 100644 --- a/folly/futures/Promise-inl.h +++ b/folly/futures/Promise-inl.h @@ -99,13 +99,7 @@ Promise::setException(E const& e) { template void Promise::setException(std::exception_ptr const& ep) { - try { - std::rethrow_exception(ep); - } catch (const std::exception& e) { - setException(exception_wrapper(std::current_exception(), e)); - } catch (...) { - setException(exception_wrapper(std::current_exception())); - } + setException(exception_wrapper::from_exception_ptr(ep)); } template