aboutsummaryrefslogtreecommitdiff
path: root/src/nix/installables.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-09-20 16:06:49 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-09-20 16:06:49 +0200
commit14d3f450098e0f4a9b8d538545f1d1bd1decdab3 (patch)
treed31cfd24dd1b984aa9134cd1935f33a69121f756 /src/nix/installables.cc
parent5a0e98d1e5697d1d28131e3fd893282be660e008 (diff)
Simplify
Diffstat (limited to 'src/nix/installables.cc')
-rw-r--r--src/nix/installables.cc22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/nix/installables.cc b/src/nix/installables.cc
index 987b744fe..85005cc95 100644
--- a/src/nix/installables.cc
+++ b/src/nix/installables.cc
@@ -425,29 +425,15 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
getDefaultFlakeAttrPathPrefixes()));
else {
- std::exception_ptr flakeEx;
-
try {
auto flakeRef = FlakeRef(s, true);
result.push_back(std::make_shared<InstallableFlake>(
*this, std::move(flakeRef), getDefaultFlakeAttrPaths()));
- continue;
- } catch (MissingFlake &) {
- /* 's' could be parsed as a flakeref, but it
- references a local path that is not a flake. So
- take note of that. */
- flakeEx = std::current_exception();
- } catch (BadFlakeRef &) {
- }
-
- if (s.find('/') != std::string::npos && (storePath = follow(s)))
- result.push_back(std::make_shared<InstallableStorePath>(*storePath));
-
- else {
- if (flakeEx)
- std::rethrow_exception(flakeEx);
+ } catch (...) {
+ if (s.find('/') != std::string::npos && (storePath = follow(s)))
+ result.push_back(std::make_shared<InstallableStorePath>(*storePath));
else
- throw Error("unsupported argument '%s'", s);
+ throw;
}
}
}