Commit 5556aa3d authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Cut Promise::setException overload taking std::exception_ptr

Summary:
[Folly] Cut `Promise::setException` overload taking `std::exception_ptr`.

It is from a time before `exception_wrapper`.

Reviewed By: marshallcline

Differential Revision: D8110117

fbshipit-source-id: f3a3f150267efc8c22a83dc90c7f52a728ef3de7
parent bf7c9957
......@@ -107,11 +107,6 @@ Promise<T>::setException(E const& e) {
setException(make_exception_wrapper<E>(e));
}
template <class T>
void Promise<T>::setException(std::exception_ptr const& ep) {
setException(exception_wrapper::from_exception_ptr(ep));
}
template <class T>
void Promise<T>::setException(exception_wrapper ew) {
throwIfFulfilled();
......
......@@ -254,14 +254,6 @@ class Promise {
/// - The associated future (if any) will complete with the exception.
void setException(exception_wrapper ew);
/// Fulfill the Promise with the exception referenced by `ep` *as if* by
/// `setException(exception_wrapper::from_exception_ptr(ep))`.
///
/// Please see `setException(exception_wrapper)` for semantics/contract.
/// Please also use `setException(exception_wrapper)` instead of this.
[[deprecated("use setException(exception_wrapper)")]]
void setException(std::exception_ptr const& ep);
/// Fulfill the Promise with exception `e` *as if* by
/// `setException(make_exception_wrapper<E>(e))`.
///
......
......@@ -315,17 +315,6 @@ TEST(Promise, setException) {
p.setException(eggs);
EXPECT_THROW(f.value(), eggs_t);
}
{
Promise<Unit> p;
auto f = p.getFuture();
// Calling setException() with an exception_ptr is deprecated,
// but don't complain about this in the test for this function.
FOLLY_PUSH_WARNING
FOLLY_GNU_DISABLE_WARNING("-Wdeprecated-declarations")
p.setException(std::make_exception_ptr(eggs));
FOLLY_POP_WARNING
EXPECT_THROW(f.value(), eggs_t);
}
{
Promise<Unit> p;
auto f = p.getFuture();
......
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