aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-01 16:22:50 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-01 16:22:50 +0000
commitc4ada76e860a595e3f034b89f27374ce79513d9f (patch)
treecc602b81249350a2d46aa462eef40cd0f3429583
parentbc165e28aee689a45535afda8012c9b63f87b24c (diff)
Fix error message and avoid recalculation
-rw-r--r--src/libfetchers/fetchers.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc
index 08b83b0db..9c69fc564 100644
--- a/src/libfetchers/fetchers.cc
+++ b/src/libfetchers/fetchers.cc
@@ -203,8 +203,8 @@ std::optional<Hash> Input::getNarHash() const
if (auto s = maybeGetStrAttr(attrs, "narHash")) {
auto hash = s->empty() ? Hash(htSHA256) : Hash::parseSRI(*s);
if (hash.type != htSHA256)
- throw UsageError("narHash must be specified with SRI notation");
- return newHashAllowEmpty(*s, htSHA256);
+ throw UsageError("narHash must use SHA-256");
+ return hash;
}
return {};
}