From 1bd9687b6e8e3c66bde9dafd7b48b0a9394a7fa4 Mon Sep 17 00:00:00 2001 From: Torstein Grindvik <52322338+torsteingrindvik@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:39:33 +0100 Subject: [PATCH] Improve file watcher error msg (#12060) # 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 Co-authored-by: Torstein Grindvik --- crates/bevy_asset/src/io/source.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/bevy_asset/src/io/source.rs b/crates/bevy_asset/src/io/source.rs index 57f6170d17b3e9..690eee2da1d2f2 100644 --- a/crates/bevy_asset/src/io/source.rs +++ b/crates/bevy_asset/src/io/source.rs @@ -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"),