1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Revert "Print the value in error: cannot coerce messages (#9553)"

This reverts commit f0ac2a35d5.

The request from the sibling PR, which also applies here, was not addressed.
https://github.com/NixOS/nix/pull/9554#issuecomment-1845095735
This commit is contained in:
Robert Hensing 2023-12-09 02:13:32 +01:00
parent d4f6b1d38b
commit 9b7b7a7561
6 changed files with 21 additions and 73 deletions

View file

@ -27,9 +27,9 @@
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <iostream>
#include <fstream>
#include <functional>
#include <sstream>
#include <sys/resource.h>
#include <nlohmann/json.hpp>
@ -2230,7 +2230,7 @@ BackedStringView EvalState::coerceToString(
return std::move(*maybeString);
auto i = v.attrs->find(sOutPath);
if (i == v.attrs->end()) {
error("cannot coerce %1% to a string: %2%", showType(v), printValue(*this, v))
error("cannot coerce %1% to a string", showType(v))
.withTrace(pos, errorCtx)
.debugThrow<TypeError>();
}
@ -2276,7 +2276,7 @@ BackedStringView EvalState::coerceToString(
}
}
error("cannot coerce %1% to a string: %2%", showType(v), printValue(*this, v))
error("cannot coerce %1% to a string", showType(v))
.withTrace(pos, errorCtx)
.debugThrow<TypeError>();
}
@ -2635,10 +2635,8 @@ void EvalState::printStatistics()
std::string ExternalValueBase::coerceToString(const Pos & pos, NixStringContext & context, bool copyMore, bool copyToStore) const
{
std::stringstream printed;
print(printed);
throw TypeError({
.msg = hintfmt("cannot coerce %1% to a string: %2%", showType(), printed.str())
.msg = hintfmt("cannot coerce %1% to a string", showType())
});
}