Add a clearer error message for InvalidPathError during evaluation
Part of #270, #271 Change-Id: I864d7340f26d3c0f9c45db7b6b545face38d8294
This commit is contained in:
@@ -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)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user