From f595edfd1ef9203ce5a8a7051121a8ea519849e2 Mon Sep 17 00:00:00 2001 From: Alexander Karzhenkov Date: Sat, 9 Dec 2023 21:20:00 +0500 Subject: [PATCH] Corrected invocation of boost::promise::set_exception --- .../redis++/future/boost/sw/redis++/async_utils.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/sw/redis++/future/boost/sw/redis++/async_utils.h b/src/sw/redis++/future/boost/sw/redis++/async_utils.h index 7445d5d0..78e1abbc 100644 --- a/src/sw/redis++/future/boost/sw/redis++/async_utils.h +++ b/src/sw/redis++/future/boost/sw/redis++/async_utils.h @@ -30,7 +30,20 @@ template using Future = boost::future; template -using Promise = boost::promise; +class Promise : public boost::promise { + using boost::promise::promise; + +public: + using boost::promise::set_exception; + + void set_exception(std::exception_ptr p) { + try { + std::rethrow_exception(p); + } catch (...) { + set_exception(boost::current_exception()); + } + } +}; }