Trim whitespace of snippets in stack traces.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
98ff6b3b69
commit
a64c2aaca8
|
@ -32,7 +32,9 @@ namespace ArbUt {
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW override { return logic_error::what(); }
|
[[nodiscard]] const char* what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW override {
|
||||||
|
return logic_error::what();
|
||||||
|
}
|
||||||
|
|
||||||
[[nodiscard]] std::string GetStacktrace([[maybe_unused]] size_t depth = 6,
|
[[nodiscard]] std::string GetStacktrace([[maybe_unused]] size_t depth = 6,
|
||||||
[[maybe_unused]] bool include_addr = true) const {
|
[[maybe_unused]] bool include_addr = true) const {
|
||||||
|
@ -102,6 +104,12 @@ namespace ArbUt {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto snippet = snippetFactory.get_snippet(source.filename, source.line, 1)[0].second;
|
auto snippet = snippetFactory.get_snippet(source.filename, source.line, 1)[0].second;
|
||||||
|
size_t p = snippet.find_first_not_of(" \t");
|
||||||
|
snippet.erase(0, p);
|
||||||
|
|
||||||
|
p = snippet.find_last_not_of(" \t");
|
||||||
|
if (std::string::npos != p)
|
||||||
|
snippet.erase(p+1);
|
||||||
if (snippet.length() > 70) {
|
if (snippet.length() > 70) {
|
||||||
snippet = snippet.substr(0, 67);
|
snippet = snippet.substr(0, 67);
|
||||||
snippet += "...";
|
snippet += "...";
|
||||||
|
|
Loading…
Reference in New Issue