| 6 | #include <boost/core/demangle.hpp> |
| 7 | |
| 8 | static std::string what_impl(const std::exception &e, size_t level) { |
| 9 | std::string nested_what; |
| 10 | try { |
| 11 | std::rethrow_if_nested(e); |
| 12 | } catch (const std::exception &n) { |
| 13 | nested_what = "\n" + what_impl(n, level + 1); |
| 14 | } catch (...) { |
| 15 | nested_what = "\n..."; |
| 16 | } |
| 17 | return std::string(level * 2, ' ') + e.what() + nested_what; |
| 18 | } |
| 19 | |
| 20 | std::string common::demangle(const char *name) { |
| 21 | std::string str = boost::core::demangle(name); |