forked from lix-project/lix
error.cc: Only suggest show-trace when truncated trace items would be printed
Otherwise, a trace consisting of frame frame frame non-frame ... would reach the non-frame and print the suggestion, even though it would have ignored the non-frame anyway. This resulted in a peculariar situation where --show-trace would have no apparent effect, as the trace was actually already complete.
This commit is contained in:
parent
4dcc0a1b76
commit
233c4cf30f
|
@ -302,14 +302,14 @@ std::ostream & showErrorInfo(std::ostream & out, const ErrorInfo & einfo, bool s
|
||||||
if (!einfo.traces.empty()) {
|
if (!einfo.traces.empty()) {
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
for (const auto & trace : einfo.traces) {
|
for (const auto & trace : einfo.traces) {
|
||||||
|
if (trace.hint.str().empty()) continue;
|
||||||
|
if (frameOnly && !trace.frame) continue;
|
||||||
|
|
||||||
if (!showTrace && count > 3) {
|
if (!showTrace && count > 3) {
|
||||||
oss << "\n" << ANSI_WARNING "(stack trace truncated; use '--show-trace' to show the full trace)" ANSI_NORMAL << "\n";
|
oss << "\n" << ANSI_WARNING "(stack trace truncated; use '--show-trace' to show the full trace)" ANSI_NORMAL << "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trace.hint.str().empty()) continue;
|
|
||||||
if (frameOnly && !trace.frame) continue;
|
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
frameOnly = trace.frame;
|
frameOnly = trace.frame;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue