Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - More detailed errors when resource not found #1864

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ impl<'a, T: Component> SystemParamFetch<'a> for ResState<T> {
.get_populated_resource_column(state.component_id)
.unwrap_or_else(|| {
panic!(
"Requested resource does not exist: {}",
"Resource requested by {} does not exist: {}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of "Resource {} does not exist, but was requested by {}"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as written it flows a bit more naturally.

system_state.name,
std::any::type_name::<T>()
)
});
Expand Down