util/PrintException: support "const char *"
This commit is contained in:
parent
424f75c9e1
commit
b02fee7309
|
@ -42,6 +42,8 @@ PrintException(const std::exception &e) noexcept
|
||||||
std::rethrow_if_nested(e);
|
std::rethrow_if_nested(e);
|
||||||
} catch (const std::exception &nested) {
|
} catch (const std::exception &nested) {
|
||||||
PrintException(nested);
|
PrintException(nested);
|
||||||
|
} catch (const char *s) {
|
||||||
|
fprintf(stderr, "%s\n", s);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
fprintf(stderr, "Unrecognized nested exception\n");
|
fprintf(stderr, "Unrecognized nested exception\n");
|
||||||
}
|
}
|
||||||
|
@ -54,6 +56,8 @@ PrintException(const std::exception_ptr &ep) noexcept
|
||||||
std::rethrow_exception(ep);
|
std::rethrow_exception(ep);
|
||||||
} catch (const std::exception &e) {
|
} catch (const std::exception &e) {
|
||||||
PrintException(e);
|
PrintException(e);
|
||||||
|
} catch (const char *s) {
|
||||||
|
fprintf(stderr, "%s\n", s);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
fprintf(stderr, "Unrecognized exception\n");
|
fprintf(stderr, "Unrecognized exception\n");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue