about summary refs log tree commit diff
path: root/tvix/build/src/proto/grpc_buildservice_wrapper.rs
diff options
context:
space:
mode:
authorMarijan Petričević <marijan.petricevic94@gmail.com>2024-10-20T00·04-0500
committerMarijan Petričević <marijan.petricevic94@gmail.com>2024-10-24T18·09+0000
commit2225b52cb54eb917c025eceb447b96d06c23dd99 (patch)
tree8c77eae93592dd3e35b3a9d8f42f06341115431c /tvix/build/src/proto/grpc_buildservice_wrapper.rs
parent1248fc0a9a297edfdb326a7b76ee03e49016a27c (diff)
refactor(tvix/build): use stricter BuildRequest type r/8855
Change-Id: Ifadd190e10ec22570ab3ccb4df54f64ae5ef0a44
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12674
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/build/src/proto/grpc_buildservice_wrapper.rs')
-rw-r--r--tvix/build/src/proto/grpc_buildservice_wrapper.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/tvix/build/src/proto/grpc_buildservice_wrapper.rs b/tvix/build/src/proto/grpc_buildservice_wrapper.rs
index 024f075de9ad..8a2d36ac569f 100644
--- a/tvix/build/src/proto/grpc_buildservice_wrapper.rs
+++ b/tvix/build/src/proto/grpc_buildservice_wrapper.rs
@@ -27,7 +27,9 @@ where
         &self,
         request: tonic::Request<BuildRequest>,
     ) -> Result<tonic::Response<Build>, tonic::Status> {
-        match self.inner.do_build(request.into_inner()).await {
+        let request = TryInto::<crate::buildservice::BuildRequest>::try_into(request.into_inner())
+            .map_err(|err| tonic::Status::new(tonic::Code::InvalidArgument, err.to_string()))?;
+        match self.inner.do_build(request).await {
             Ok(resp) => Ok(tonic::Response::new(resp)),
             Err(e) => Err(tonic::Status::internal(e.to_string())),
         }