mirror of
https://github.com/NixOS/nix
synced 2025-06-26 11:41:15 +02:00
Print value on type error
Adds the failing value to `value is <TYPE> while a <TYPE> is expected` error messages.
This commit is contained in:
parent
b74ec56da9
commit
cb7fbd4d83
19 changed files with 227 additions and 136 deletions
|
@ -335,7 +335,7 @@ std::ostream & showErrorInfo(std::ostream & out, const ErrorInfo & einfo, bool s
|
|||
* try {
|
||||
* e->eval(*this, env, v);
|
||||
* if (v.type() != nAttrs)
|
||||
* throwTypeError("value is %1% while a set was expected", v);
|
||||
* throwTypeError("expected a set but found %1%", v);
|
||||
* } catch (Error & e) {
|
||||
* e.addTrace(pos, errorCtx);
|
||||
* throw;
|
||||
|
@ -349,7 +349,7 @@ std::ostream & showErrorInfo(std::ostream & out, const ErrorInfo & einfo, bool s
|
|||
* e->eval(*this, env, v);
|
||||
* try {
|
||||
* if (v.type() != nAttrs)
|
||||
* throwTypeError("value is %1% while a set was expected", v);
|
||||
* throwTypeError("expected a set but found %1%", v);
|
||||
* } catch (Error & e) {
|
||||
* e.addTrace(pos, errorCtx);
|
||||
* throw;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue