From 20ac0e3e4874ab41a3dc1dba5314d4b5673316a1 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 22 Oct 2015 01:34:01 +0900 Subject: [PATCH] src: Print out exception type --- src/template.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); }