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 message on incorrect asset label #11254

Merged
merged 1 commit into from Jan 8, 2024

Conversation

stepancheg
Copy link
Contributor

Objective

When you have no idea what to put after # when loading an asset, error message may help.

Solution

Add all labels to the error message.

Test plan

Modified anti_alias example to put incorrect label, the error is:

2024-01-08T07:41:25.462287Z ERROR bevy_asset::server: The file at 'models/FlightHelmet/FlightHelmet.gltf' does not contain the labeled asset 'Rrrr'; it contains the following 25 assets: 'Material0', 'Material1', 'Material2', 'Material3', 'Material4', 'Material5', 'Mesh0', 'Mesh0/Primitive0', 'Mesh1', 'Mesh1/Primitive0', 'Mesh2', 'Mesh2/Primitive0', 'Mesh3', 'Mesh3/Primitive0', 'Mesh4', 'Mesh4/Primitive0', 'Mesh5', 'Mesh5/Primitive0', 'Node0', 'Node1', 'Node2', 'Node3', 'Node4', 'Node5', 'Scene0'

@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 simple quality-of-life change that makes Bevy easier to use labels Jan 8, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Really nice: this has frustrated me in the past.

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Jan 8, 2024
@mockersf
Copy link
Member

mockersf commented Jan 8, 2024

on a realistic gltf file, that is probably going to be a very long and not that useful list of labels

@rlidwka
Copy link
Contributor

rlidwka commented Jan 8, 2024

on a realistic gltf file, that is probably going to be a very long and not that useful list of labels

I believe the list is always useful, at least having it is definitely more useful than not having it.

It can be long though, so it might be a good idea to cap the number of visible entries (e.g. collect at most of 32 of them).

@JMS55
Copy link
Contributor

JMS55 commented Jan 8, 2024

I'd be fine limiting it to 32 with a ... At the end. But I'd also be fine printing the whole thing. I think more debug info is useful for errors vs less, even if it's extremely verbose.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 8, 2024
Merged via the queue into bevyengine:main with commit c0f8338 Jan 8, 2024
26 checks passed
@stepancheg stepancheg deleted the asset-label branch January 8, 2024 23:41
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 simple quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants