diff options
Diffstat (limited to 'third_party/nix/src/nix/search.cc')
-rw-r--r-- | third_party/nix/src/nix/search.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/nix/src/nix/search.cc b/third_party/nix/src/nix/search.cc index 994fccd5642f..5978d197fec6 100644 --- a/third_party/nix/src/nix/search.cc +++ b/third_party/nix/src/nix/search.cc @@ -251,13 +251,15 @@ struct CmdSearch : SourceExprCommand, MixJSON { } if (writeCache && - rename(tmpFile.c_str(), jsonCacheFileName.c_str()) == -1) + rename(tmpFile.c_str(), jsonCacheFileName.c_str()) == -1) { throw SysError("cannot rename '%s' to '%s'", tmpFile, jsonCacheFileName); + } } - if (results.size() == 0) + if (results.size() == 0) { throw Error("no results for the given search term(s)!"); + } RunPager pager; for (auto el : results) { |