Skip to content

Commit

Permalink
Improve file watcher error msg (bevyengine#12060)
Browse files Browse the repository at this point in the history
# Objective

When dealing with custom asset sources it can be a bit tricky to get
asset roots combined with relative paths correct.
It's even harder when it isn't mentioned which path was problematic.

## Solution

Mention which path failed for the file watcher.

Signed-off-by: Torstein Grindvik <torstein.grindvik@muybridge.com>
Co-authored-by: Torstein Grindvik <torstein.grindvik@muybridge.com>
  • Loading branch information
2 people authored and msvbg committed Feb 26, 2024
1 parent 7e967fd commit 1bd9687
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/bevy_asset/src/io/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,9 @@ impl AssetSource {
sender,
file_debounce_wait_time,
)
.expect("Failed to create file watcher"),
.unwrap_or_else(|e| {
panic!("Failed to create file watcher from path {path:?}, {e:?}")
}),
));
#[cfg(any(
not(feature = "file_watcher"),
Expand Down

0 comments on commit 1bd9687

Please sign in to comment.