about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix')
-rw-r--r--tvix/castore/src/composition.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/tvix/castore/src/composition.rs b/tvix/castore/src/composition.rs
index 1ff7e1b5bed8..53e2fe1594fb 100644
--- a/tvix/castore/src/composition.rs
+++ b/tvix/castore/src/composition.rs
@@ -431,10 +431,13 @@ impl Composition {
                         new_context
                             .stack
                             .push((TypeId::of::<T>(), entrypoint.clone()));
-                        let res = config
-                            .build(&entrypoint, &new_context)
-                            .await
-                            .map_err(|e| CompositionError::Failed(entrypoint, e.into()));
+                        let res =
+                            config.build(&entrypoint, &new_context).await.map_err(|e| {
+                                match e.downcast() {
+                                    Ok(e) => *e,
+                                    Err(e) => CompositionError::Failed(entrypoint, e.into()),
+                                }
+                            });
                         tx.send(Some(res.clone())).unwrap();
                         res
                     })