fix(tvix/store/nar/renderer): handle digest error
Change-Id: I183580732e1dd33ed079a2593097ec790def0a55 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8554 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
b46f2b52c7
commit
a226a3c2c4
1 changed files with 7 additions and 3 deletions
|
@ -58,8 +58,13 @@ impl<BS: BlobService, CS: ChunkService + Clone, DS: DirectoryService> NARRendere
|
||||||
.map_err(RenderError::NARWriterError)?;
|
.map_err(RenderError::NARWriterError)?;
|
||||||
}
|
}
|
||||||
proto::node::Node::File(proto_file_node) => {
|
proto::node::Node::File(proto_file_node) => {
|
||||||
// get the digest we're referring to
|
let digest: [u8; 32] =
|
||||||
let digest = &proto_file_node.digest;
|
proto_file_node.digest.to_owned().try_into().map_err(|_e| {
|
||||||
|
RenderError::StoreError(crate::Error::StorageError(
|
||||||
|
"invalid digest len in file node".to_string(),
|
||||||
|
))
|
||||||
|
})?;
|
||||||
|
|
||||||
// query blob_service for blob_meta
|
// query blob_service for blob_meta
|
||||||
let resp = self
|
let resp = self
|
||||||
.blob_service
|
.blob_service
|
||||||
|
@ -105,7 +110,6 @@ impl<BS: BlobService, CS: ChunkService + Clone, DS: DirectoryService> NARRendere
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
proto::node::Node::Directory(proto_directory_node) => {
|
proto::node::Node::Directory(proto_directory_node) => {
|
||||||
// get the digest we're referring to
|
|
||||||
let digest: [u8; 32] =
|
let digest: [u8; 32] =
|
||||||
proto_directory_node
|
proto_directory_node
|
||||||
.digest
|
.digest
|
||||||
|
|
Loading…
Reference in a new issue