util/Exception: support "const char *"

This commit is contained in:
Max Kellermann 2019-08-21 12:19:03 +02:00 committed by Max Kellermann
parent 71c45d8ebe
commit e7c5a59e39
1 changed files with 5 additions and 0 deletions

View File

@ -42,6 +42,9 @@ AppendNestedMessage(std::string &result, T &&e,
AppendNestedMessage(result, nested, fallback, separator);
} catch (const std::nested_exception &ne) {
AppendNestedMessage(result, ne, fallback, separator);
} catch (const char *s) {
result += separator;
result += s;
} catch (...) {
result += separator;
result += fallback;
@ -67,6 +70,8 @@ GetFullMessage(std::exception_ptr ep,
return GetFullMessage(e, fallback, separator);
} catch (const std::nested_exception &ne) {
return GetFullMessage(ne.nested_ptr(), fallback, separator);
} catch (const char *s) {
return s;
} catch (...) {
return fallback;
}