From 13d4d1c0a2489a5fab506da57149863daf7f01b1 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Fri, 20 Apr 2018 21:07:32 +0200 Subject: [PATCH] download: make hash mismatch error consistent with fetchurl --- src/libstore/download.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstore/download.cc b/src/libstore/download.cc index 4d7f56901..538c558f5 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -730,8 +730,8 @@ Path Downloader::downloadCached(ref store, const string & url_, bool unpa Hash gotHash = unpack ? hashPath(expectedHash.type, store->toRealPath(storePath)).first : hashFile(expectedHash.type, store->toRealPath(storePath)); - throw nix::Error("hash mismatch in file downloaded from '%s': expected hash '%s', got '%s'", - url, expectedHash.to_string(), gotHash.to_string()); + throw nix::Error("hash mismatch in file downloaded from '%s': got hash '%s' instead of the expected hash '%s'", + url, gotHash.to_string(), expectedHash.to_string()); } return store->toRealPath(storePath);