From 2cb56aeb16db8f3b10ee8760789eb2088912294c Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 29 Jun 2022 17:08:09 +0200 Subject: Error reporting: also abbreviate the expression in the stack trace ... to the same limit as the values occuring in the stack. --- share/man/just.1.org | 3 ++- src/buildtool/build_engine/expression/evaluator.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/share/man/just.1.org b/share/man/just.1.org index 14bd8183..7331f06b 100644 --- a/share/man/just.1.org +++ b/share/man/just.1.org @@ -341,7 +341,8 @@ well-defined graph file. See *just-graph-file(5)* for more details. *--expression-log-limit* NUM\\ In error messages, truncate the entries in the enumeration of the active - environment to the specified number of characters (default: 320).\\ + environment, as well as the expression to be evaluated, to the specified + number of characters (default: 320).\\ Supported by: analyse|build|install *-P*, *--print-to-stdout* LOGICAL_PATH\\ diff --git a/src/buildtool/build_engine/expression/evaluator.cpp b/src/buildtool/build_engine/expression/evaluator.cpp index 0097bd27..af5d46ed 100644 --- a/src/buildtool/build_engine/expression/evaluator.cpp +++ b/src/buildtool/build_engine/expression/evaluator.cpp @@ -920,7 +920,7 @@ auto Evaluator::EvaluationError::WhileEvaluating(ExpressionPtr const& expr, expr["type"]->IsString()) { ss << expr["type"]->ToString() << "-expression "; } - ss << expr->ToString() << std::endl; + ss << expr->ToAbbrevString(Config().expression_log_limit) << std::endl; ss << " environment " << std::endl; ss << env.Enumerate(" - ", Config().expression_log_limit) << std::endl; ss << ex.what(); -- cgit v1.2.3