feat(tvix/composition): improve error message for unknown tag
Change-Id: I61a31488de17725ae4311f5f5bf8e02edb752cf9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12017 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
5d82e1e62f
commit
8342f70c60
1 changed files with 2 additions and 2 deletions
|
@ -149,7 +149,7 @@ impl<'r, 'de: 'r, T: 'static> SeedFactory<'de, TagString<'de>> for RegistryWithF
|
|||
.0
|
||||
.iter()
|
||||
.find(|(k, _)| *k == &(TypeId::of::<T>(), tag.as_ref()))
|
||||
.ok_or_else(|| serde::de::Error::custom("Unknown tag"))?
|
||||
.ok_or_else(|| serde::de::Error::custom(format!("Unknown type: {}", tag)))?
|
||||
.1;
|
||||
|
||||
let entry: &RegistryEntry<T> = <dyn Any>::downcast_ref(&**seed).unwrap();
|
||||
|
@ -215,7 +215,7 @@ impl<'de, T: 'static> serde::Deserialize<'de> for DeserializeWithRegistry<T> {
|
|||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
enum TryFromUrlError {
|
||||
#[error("Unknown tag: {0}")]
|
||||
#[error("Unknown type: {0}")]
|
||||
UnknownTag(String),
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue