diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-04-27 18:55:20 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-04-27 18:55:20 +0200 |
commit | b51dff431c1e7d37cec97e0fe7c8945547dfd7f0 (patch) | |
tree | a010bbcb3e622f5e9d9a227db16e6ccaa99e0f76 | |
parent | b4e23dcd9e0a52644517f8a7777e3c2e6b92481a (diff) |
Improve error message when an argument is not a flake
-rw-r--r-- | src/nix/installables.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc index 0c2c5fe63..3871536e1 100644 --- a/src/nix/installables.cc +++ b/src/nix/installables.cc @@ -468,7 +468,10 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables( if (s.find('/') != std::string::npos && (storePath = follow(s))) result.push_back(std::make_shared<InstallableStorePath>(store, store->printStorePath(*storePath))); else - throw Error("unrecognized argument '%s'", s); + throw Error( + pathExists(s) + ? "path '%s' is not a flake or a store path" + : "don't know how to handle argument '%s'", s); } } } |