diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-01 16:22:50 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-01 16:22:50 +0000 |
commit | c4ada76e860a595e3f034b89f27374ce79513d9f (patch) | |
tree | cc602b81249350a2d46aa462eef40cd0f3429583 | |
parent | bc165e28aee689a45535afda8012c9b63f87b24c (diff) |
Fix error message and avoid recalculation
-rw-r--r-- | src/libfetchers/fetchers.cc | 4 |
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 {}; } |