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

Better error messages when Resources can't be found #1846

Closed
concave-sphere opened this issue Apr 7, 2021 · 0 comments
Closed

Better error messages when Resources can't be found #1846

concave-sphere opened this issue Apr 7, 2021 · 0 comments
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@concave-sphere
Copy link

What problem does this solve or what need does it fill?

If one of my systems requests a Resource that doesn't exist, I get a panic with a message like Requested resource does not exist: ResourceType and a stack trace deep into the Bevy scheduler. I can't tell which system was trying to request the resource.

What solution would you like?

There should be a way to find out which system is at fault. If multiple systems are asking for ResourceType, it's possible that some of them are fine due to stage/ordering constraints; I would like to focus on the one that caused the crash.

Possible solutions:

  • Include the system name in the panic message
  • Add trace-level logs of system related events (e.g, "about to execute system X"), which would help with other general debugging tasks related to system execution

What alternative(s) have you considered?

Staring at the code and commenting stuff out until the crash goes away works, but is laborious and time consuming.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Apr 7, 2021
@bors bors bot closed this as completed in c86d490 Apr 14, 2021
bors bot pushed a commit that referenced this issue Apr 23, 2021
…1986)

Some panic messages for systems include the system name, but there's a few panic messages which do not. This PR adds the system name for the remaining panic messages.

This is a continuation of the work done in #1864.
Related: #1846
ostwilkens pushed a commit to ostwilkens/bevy that referenced this issue Jul 27, 2021
Fixes bevyengine#1846

Got scared of the other "Requested resource does not exist" error at line 395 in `system_param.rs`, under `impl<'a, T: Component> SystemParamFetch<'a> for ResMutState<T> {`. Someone with better knowledge of the code might be able to go in and improve that one.
ostwilkens pushed a commit to ostwilkens/bevy that referenced this issue Jul 27, 2021
…evyengine#1986)

Some panic messages for systems include the system name, but there's a few panic messages which do not. This PR adds the system name for the remaining panic messages.

This is a continuation of the work done in bevyengine#1864.
Related: bevyengine#1846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants