aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorBen Burdette <bburdette@gmail.com>2020-06-24 13:46:25 -0600
committerBen Burdette <bburdette@gmail.com>2020-06-24 13:46:25 -0600
commit023912def37c8db64dec0339d39f2535e0d79e78 (patch)
tree8717fe3d3969291259def7aa9d43d29c3d879dd1 /src/libexpr
parent93e9307329567c9f181318c4d4d6dc09de20ea48 (diff)
convenience form of addTrace
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc6
-rw-r--r--src/libexpr/primops.cc12
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 3fd8aa285..1cbbb7ade 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -594,17 +594,17 @@ LocalNoInlineNoReturn(void throwUndefinedVarError(const Pos & pos, const char *
LocalNoInline(void addErrorTrace(Error & e, const char * s, const string & s2))
{
- e.addTrace(std::nullopt, hintfmt(s) % s2);
+ e.addTrace(std::nullopt, s, s2);
}
LocalNoInline(void addErrorTrace(Error & e, const Pos & pos, const char * s, const ExprLambda & fun))
{
- e.addTrace(pos, hintfmt(s) % fun.showNamePos());
+ e.addTrace(pos, s, fun.showNamePos());
}
LocalNoInline(void addErrorTrace(Error & e, const Pos & pos, const char * s, const string & s2))
{
- e.addTrace(pos, hintfmt(s) % s2);
+ e.addTrace(pos, s, s2);
}
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 6f7a691cd..4cc3718e3 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -239,13 +239,13 @@ void prim_exec(EvalState & state, const Pos & pos, Value * * args, Value & v)
try {
parsed = state.parseExprFromString(output, pos.file);
} catch (Error & e) {
- e.addTrace(pos, hintfmt("While parsing the output from '%1%'", program));
+ e.addTrace(pos, "While parsing the output from '%1%'", program);
throw;
}
try {
state.eval(parsed, v);
} catch (Error & e) {
- e.addTrace(pos, hintfmt("While evaluating the output from '%1%'", program));
+ e.addTrace(pos, "While evaluating the output from '%1%'", program);
throw;
}
}
@@ -472,7 +472,7 @@ static void prim_addErrorContext(EvalState & state, const Pos & pos, Value * * a
} catch (Error & e) {
PathSet context;
// TODO: is this right, include this pos?? Test it. esp with LOC.
- e.addTrace(pos, hintfmt("%1%") % state.coerceToString(pos, *args[0], context));
+ e.addTrace(pos, "%1%", state.coerceToString(pos, *args[0], context));
throw;
}
}
@@ -564,7 +564,7 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
try {
drvName = state.forceStringNoCtx(*attr->value, pos);
} catch (Error & e) {
- e.addTrace(posDrvName, hintfmt("while evaluating the derivation attribute 'name'"));
+ e.addTrace(posDrvName, "while evaluating the derivation attribute 'name'");
throw;
}
@@ -698,8 +698,8 @@ static void prim_derivationStrict(EvalState & state, const Pos & pos, Value * *
} catch (Error & e) {
e.addTrace(posDrvName,
- hintfmt("while evaluating the attribute '%1%' of the derivation '%2%'",
- key, drvName));
+ "while evaluating the attribute '%1%' of the derivation '%2%'",
+ key, drvName);
throw;
}
}