From b02fee7309c0e213f07f560ac292835c51b44a4e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Jan 2019 21:19:35 +0100 Subject: [PATCH] util/PrintException: support "const char *" --- src/util/PrintException.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/PrintException.cxx b/src/util/PrintException.cxx index 54ea71c07..0e1971077 100644 --- a/src/util/PrintException.cxx +++ b/src/util/PrintException.cxx @@ -42,6 +42,8 @@ PrintException(const std::exception &e) noexcept std::rethrow_if_nested(e); } catch (const std::exception &nested) { PrintException(nested); + } catch (const char *s) { + fprintf(stderr, "%s\n", s); } catch (...) { fprintf(stderr, "Unrecognized nested exception\n"); } @@ -54,6 +56,8 @@ PrintException(const std::exception_ptr &ep) noexcept std::rethrow_exception(ep); } catch (const std::exception &e) { PrintException(e); + } catch (const char *s) { + fprintf(stderr, "%s\n", s); } catch (...) { fprintf(stderr, "Unrecognized exception\n"); }