Commit f29949e1 authored by Max Kellermann's avatar Max Kellermann

command/Error: support class Error as C++ exception

parent 75aa98dd
......@@ -128,6 +128,8 @@ ToAck(std::exception_ptr ep)
#if defined(__GLIBCXX__) && __GLIBCXX__ < 20151204
} catch (const std::exception &e) {
#else
} catch (const Error &error) {
return ToAck(error);
} catch (...) {
#endif
try {
......@@ -153,6 +155,8 @@ PrintError(Response &r, std::exception_ptr ep)
} catch (const std::exception &e) {
LogError(e);
r.Error(ToAck(ep), e.what());
} catch (const Error &error) {
print_error(r, error);
} catch (...) {
r.Error(ACK_ERROR_UNKNOWN, "Unknown error");
}
......
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