util/Exception: move the forwarded std::exception_ptr

This commit is contained in:
Max Kellermann 2020-02-01 13:13:08 +01:00
parent f7c326dbeb
commit 620872390b

View File

@ -29,6 +29,8 @@
#include "Exception.hxx"
#include <utility>
template<typename T>
static void
AppendNestedMessage(std::string &result, T &&e,
@ -65,7 +67,7 @@ GetFullMessage(std::exception_ptr ep,
const char *fallback, const char *separator) noexcept
{
try {
std::rethrow_exception(ep);
std::rethrow_exception(std::move(ep));
} catch (const std::exception &e) {
return GetFullMessage(e, fallback, separator);
} catch (const std::nested_exception &ne) {