diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-07-02T15·37+0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-02T15·37+0200 |
commit | 7e1c85c5fbf48811bb9a4969f9c32fce2a3e5fa7 (patch) | |
tree | 4b6d7b4f6ab4e6eaaa1201167ab37ae30ffa0959 /src/libstore/download.cc | |
parent | db700f730ee4543d41974089b225b365ec427028 (diff) | |
parent | 68bdd83dc88ec55c6c51fa92e84e7d7d408c554a (diff) |
Merge pull request #2779 from LnL7/build-exit-codes
build: add exit code for hash and check mismatches
Diffstat (limited to 'src/libstore/download.cc')
-rw-r--r-- | src/libstore/download.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc index 0c5a73ea3c51..7a2af237ee8f 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -855,10 +855,11 @@ CachedDownloadResult Downloader::downloadCached( } if (expectedStorePath != "" && storePath != expectedStorePath) { + unsigned int statusCode = 102; Hash gotHash = request.unpack ? hashPath(request.expectedHash.type, store->toRealPath(storePath)).first : hashFile(request.expectedHash.type, store->toRealPath(storePath)); - throw nix::Error("hash mismatch in file downloaded from '%s':\n wanted: %s\n got: %s", + throw nix::Error(statusCode, "hash mismatch in file downloaded from '%s':\n wanted: %s\n got: %s", url, request.expectedHash.to_string(), gotHash.to_string()); } |