feat(tvix/composition): downcast boxed error if possible
We still have the unique store name to identify which instantiation caused the error. For recursion errors, the full chain is still retained inside the CompositionError. Change-Id: Iaddcece445a5df331e578d7c69d710db3d5f8dcd Reviewed-on: https://cl.tvl.fyi/c/depot/+/12002 Tested-by: BuildkiteCI Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
parent
1f89cf9027
commit
76394daca3
1 changed files with 7 additions and 4 deletions
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue