From b51dff431c1e7d37cec97e0fe7c8945547dfd7f0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Apr 2020 18:55:20 +0200 Subject: [PATCH] Improve error message when an argument is not a flake --- src/nix/installables.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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> SourceExprCommand::parseInstallables( if (s.find('/') != std::string::npos && (storePath = follow(s))) result.push_back(std::make_shared(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); } } }