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

We need a useful error message when two materials have the save UUID #3731

Closed
eliotbo opened this issue Jan 20, 2022 · 5 comments
Closed

We need a useful error message when two materials have the save UUID #3731

eliotbo opened this issue Jan 20, 2022 · 5 comments
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@eliotbo
Copy link

eliotbo commented Jan 20, 2022

Bevy version

0.6,

What you did

Take the shader_material example and add second material to it with the same UUID, but different name.

What you expected to happen

I expected either a run time error message or a warning about having two identical UUID.

What actually happened

There was a runtime error with not much information:

thread 'Compute Task Pool (20)' panicked at 'called `Option::unwrap()` on a `None` value', /home/eliotbolduc/Documents/rust/bevy_fork/crates/bevy_asset/src/asset_server.rs:505:14

It refers to this line in asset_server.rs:

let channel = asset_lifecycle
       .downcast_ref::<AssetLifecycleChannel<T>>()
       .unwrap(); ```
@eliotbo eliotbo added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 20, 2022
@rparrett
Copy link
Contributor

Related: #2610

@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy and removed C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 20, 2022
@ByAlu
Copy link

ByAlu commented Jan 22, 2022

@alice-i-cecile This is my first time contributing. I don't know rust language but I have some programming experience. May I work on this issue?

@alice-i-cecile
Copy link
Member

@ByAlu absolutely! Just open a PR and then link this issue :)

@mockersf
Copy link
Member

@ByAlu there is already a pr for this issue: #3739

bors bot pushed a commit that referenced this issue Feb 12, 2022
# Objective
Fixes #2610 and #3731

## Solution

Added check for TYPE_UUID duplication in  `register_asset_type` with an error message
@ZainlessBrombie
Copy link

On latest main (b3a2cbb):
thread 'main' panicked at 'Error while registering new asset type: "shader_material::CustomMaterial2" with UUID: f690fdae-d598-45ab-8225-97e2a3f056e0. Another type with the same UUID is already registered. Can not register new asset type with the same UUID', /tmp/bevy/crates/bevy_asset/src/asset_server.rs:110:13

I think this can be closed then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

No branches or pull requests

6 participants