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) { } }; diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index de4dc3f03..186437f43 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -62,10 +62,18 @@ MakeError(SubstError, Error); * denotes a permanent build failure */ MakeError(BuildError, Error); +/** + * denotes that a path in the store did not exist (but it could, had it + * been put there, i.e. it is still legal). + */ MakeError(InvalidPath, Error); MakeError(Unsupported, Error); MakeError(SubstituteGone, Error); MakeError(SubstituterDisabled, Error); +/** + * denotes that a path could not possibly be a store path. + * e.g. outside of the nix store, illegal characters in the name, etc. +*/ MakeError(BadStorePath, Error); MakeError(InvalidStoreURI, Error); @@ -328,6 +336,7 @@ public: /** * Check whether a path is valid. + * A path is valid when it exists in the store *now*. */ bool isValidPath(const StorePath & path);