mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
add more informative "resource does not exist" errors
This commit is contained in:
parent
f4fe9abda8
commit
86f41ae0a4
1 changed files with 2 additions and 2 deletions
|
@ -140,7 +140,7 @@ impl Resources {
|
|||
let archetype = self
|
||||
.resource_archetypes
|
||||
.get(&TypeId::of::<T>())
|
||||
.expect("Resource does not exist");
|
||||
.unwrap_or_else(|| panic!("Resource does not exist {}", std::any::type_name::<T>()));
|
||||
Res::new(archetype, 0).expect("Resource does not exist")
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ impl Resources {
|
|||
let archetype = self
|
||||
.resource_archetypes
|
||||
.get(&TypeId::of::<T>())
|
||||
.expect("Resource does not exist");
|
||||
.unwrap_or_else(|| panic!("Resource does not exist {}", std::any::type_name::<T>()));
|
||||
ResMut::new(archetype, 0).expect("Resource does not exist")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue