aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval-error.hh
diff options
context:
space:
mode:
authorjulia <midnight@trainwit.ch>2024-05-18 18:57:38 +1000
committerjulia <midnight@trainwit.ch>2024-06-16 03:53:00 +0000
commit6c311a4afa339b5dc4f80f03e29c9e7fe779abd5 (patch)
tree2ed6d3ec15709b772806a4c04d1f5c4e5480cca9 /src/libexpr/eval-error.hh
parent0fa289f559708407ab4384739c0f24258c114b44 (diff)
Add a clearer error message for InvalidPathError during evaluation
Part of #270, #271 Change-Id: I864d7340f26d3c0f9c45db7b6b545face38d8294
Diffstat (limited to 'src/libexpr/eval-error.hh')
-rw-r--r--src/libexpr/eval-error.hh6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libexpr/eval-error.hh b/src/libexpr/eval-error.hh
index 4f0e0d24c..19540d612 100644
--- a/src/libexpr/eval-error.hh
+++ b/src/libexpr/eval-error.hh
@@ -47,12 +47,16 @@ MakeError(MissingArgumentError, EvalError);
MakeError(RestrictedPathError, Error);
MakeError(InfiniteRecursionError, EvalError);
+/**
+ * Represents an exception due to an invalid path; that is, it does not exist.
+ * It corresponds to `!Store::validPath()`.
+ */
struct InvalidPathError : public EvalError
{
public:
Path path;
InvalidPathError(EvalState & state, const Path & path)
- : EvalError(state, "path '%s' is not valid", path)
+ : EvalError(state, "path '%s' did not exist in the store during evaluation", path)
{
}
};