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

Missing Asset error doesn't say which asset is missing #10438

Closed
anarelion opened this issue Nov 8, 2023 · 5 comments
Closed

Missing Asset error doesn't say which asset is missing #10438

anarelion opened this issue Nov 8, 2023 · 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

@anarelion
Copy link
Contributor

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

Error is difficult to address

2023-11-08T00:09:15.785413Z ERROR bevy_asset::server: encountered an io error while loading asset: The system cannot find the file specified. (os error 2)

What solution would you like?

I would like to know which file is missing.

What alternative(s) have you considered?

I can find out, but it will take me time. I think it is much better if the error message is complete.

@anarelion anarelion added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 8, 2023
@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-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 8, 2023
@orph3usLyre
Copy link
Contributor

Hi, I'd like to take this up as my first issue!

Just to make sure that I understand correctly: would this require changing the ReadAssetBytesError::Io(#[from] std::io::Error) variant to also hold the the missing file path (and updating the error caller appropriately)?

@killercup
Copy link
Contributor

Yup! The easiest option is to remove the #[from] and add another field, then fix the compiler errors you encounter (probably using map_err and manual construction of the error variant).

@orph3usLyre
Copy link
Contributor

Awesome, thanks!

github-merge-queue bot pushed a commit that referenced this issue Nov 16, 2023
# Objective

Addresses #[10438](#10438)

The objective was to include the failing path in the error for the user
to see.

## Solution

Add a `path` field to the `ReadAssetBytesError::Io` variant to expose
the failing path in the error message.

## Migration Guide
- The `ReadAssetBytesError::Io` variant now contains two named fields
instead of converting from `std::io::Error`.
    1. `path`: The requested (failing) path (`PathBuf`)
    2. `source`: The source `std::io::Error`

---------

Co-authored-by: Alice Cecile <[email protected]>
@DasLixou
Copy link
Contributor

i think this can be closed?

rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this issue Jan 9, 2024
# Objective

Addresses #[10438](bevyengine#10438)

The objective was to include the failing path in the error for the user
to see.

## Solution

Add a `path` field to the `ReadAssetBytesError::Io` variant to expose
the failing path in the error message.

## Migration Guide
- The `ReadAssetBytesError::Io` variant now contains two named fields
instead of converting from `std::io::Error`.
    1. `path`: The requested (failing) path (`PathBuf`)
    2. `source`: The source `std::io::Error`

---------

Co-authored-by: Alice Cecile <[email protected]>
@nicopap
Copy link
Contributor

nicopap commented Feb 20, 2024

My testing shows this is fixed indeed. Closed by #10450

@nicopap nicopap closed this as completed Feb 20, 2024
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