diff options
author | Ben Burdette <bburdette@gmail.com> | 2020-04-06 10:00:00 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@gmail.com> | 2020-04-06 10:00:00 -0600 |
commit | 216263c36f7827a1cf578627579f9cb074dc2749 (patch) | |
tree | f9cd590c619319be2b3116f03f1f369051797fcc /src/nix/edit.cc | |
parent | 1221ae3dd07959d47d9f27e9d2271671003d2bed (diff) | |
parent | ebb20a5356af023498506324bd0f88a99175e295 (diff) |
Merge branch 'master' into error-format
Diffstat (limited to 'src/nix/edit.cc')
-rw-r--r-- | src/nix/edit.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nix/edit.cc b/src/nix/edit.cc index ca410cd1f..1683eada0 100644 --- a/src/nix/edit.cc +++ b/src/nix/edit.cc @@ -29,9 +29,15 @@ struct CmdEdit : InstallableCommand { auto state = getEvalState(); - auto v = installable->toValue(*state); + auto [v, pos] = installable->toValue(*state); - Pos pos = findDerivationFilename(*state, *v, installable->what()); + try { + pos = findDerivationFilename(*state, *v, installable->what()); + } catch (NoPositionInfo &) { + } + + if (pos == noPos) + throw Error("cannot find position information for '%s", installable->what()); stopProgressBar(); |