diff --git a/src/template.h b/src/template.h index d5f1a769..af5d596b 100644 --- a/src/template.h +++ b/src/template.h @@ -33,6 +33,7 @@ #include #include #include +#include namespace nghttp2 { @@ -205,9 +206,7 @@ inline int run_app(std::function app, int argc, } catch (const std::bad_alloc &) { fputs("Out of memory\n", stderr); } catch (const std::exception &x) { - fputs("Exception caught: ", stderr); - fputs(x.what(), stderr); - fputs("\n", stderr); + fprintf(stderr, "Caught %s:\n%s\n", typeid(x).name(), x.what()); } catch (...) { fputs("Unknown exception caught\n", stderr); }