From 570dcb63092c73e4f14236ded401698c6663416d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Dec 2015 07:00:01 +0100 Subject: [PATCH] command/Error: support nested exceptions --- src/command/CommandError.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/command/CommandError.cxx b/src/command/CommandError.cxx index 941a7c990..42e622727 100644 --- a/src/command/CommandError.cxx +++ b/src/command/CommandError.cxx @@ -171,7 +171,12 @@ ToAck(std::exception_ptr ep) } catch (const std::system_error &e) { return ACK_ERROR_SYSTEM; } catch (...) { - return ACK_ERROR_UNKNOWN; + try { + std::rethrow_if_nested(ep); + return ACK_ERROR_UNKNOWN; + } catch (...) { + return ToAck(std::current_exception()); + } } }