chore(3p/nix/hash): prefer StatusOr over throwing constructor

The use of `unwrap_throw` can be used as a later grep target.

Change-Id: I8c54ed90c4289f07aecb8a1393dd10204c8bce4e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1493
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
This commit is contained in:
Kane York 2020-07-27 19:57:04 -07:00 committed by kanepyork
parent 2a292c71f4
commit 1cbffe21f3
15 changed files with 97 additions and 49 deletions

View file

@ -100,7 +100,8 @@ void RpcStore::queryPathInfoUncached(
if (!info->deriver.empty()) {
assertStorePath(info->deriver);
}
info->narHash = Hash(path_info.nar_hash(), htSHA256);
auto hash_ = Hash::deserialize(path_info.nar_hash(), htSHA256);
info->narHash = Hash::unwrap_throw(hash_);
info->references.insert(path_info.references().begin(),
path_info.references().end());
info->registrationTime =