diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/direct_bt/BasicTypes.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/direct_bt/BasicTypes.cpp b/src/direct_bt/BasicTypes.cpp index cfd9b29e..ce3519e5 100644 --- a/src/direct_bt/BasicTypes.cpp +++ b/src/direct_bt/BasicTypes.cpp @@ -50,11 +50,17 @@ int64_t direct_bt::getCurrentMilliseconds() noexcept { return t.tv_sec * MilliPerOne + t.tv_nsec / NanoPerMilli; } +direct_bt::RuntimeException::RuntimeException(std::string const type, std::string const m, const char* file, int line) noexcept +: msg(std::string(type).append(" @ ").append(file).append(":").append(std::to_string(line)).append(": ").append(m)), + backtrace(direct_bt::get_backtrace(1)) +{ +} + const char* direct_bt::RuntimeException::what() const noexcept { // return std::runtime_error::what(); std::string out(msg); - out.append("\nBacktrace:\n"); - out.append(get_backtrace(1)); + out.append("\nNative backtrace:\n"); + out.append(backtrace); return out.c_str(); } |