command/Error: support nested exceptions

This commit is contained in:
Max Kellermann 2015-12-28 07:00:01 +01:00
parent 19e43087a8
commit 570dcb6309

View File

@ -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());
}
}
}