Skip to content

Commit

Permalink
revision: canonicalize err handling
Browse files Browse the repository at this point in the history
  • Loading branch information
DogeDark committed Dec 11, 2024
1 parent 3bfc782 commit 30b1d03
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/cli/src/serve/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,9 @@ impl AppHandle {
}

// Canonicalize the path as Windows may use long-form paths "\\\\?\\C:\\".
let changed_file = match fs::canonicalize(changed_file) {
Ok(c) => c,
Err(e) => {
tracing::debug!("Failed to canonicalize hotreloaded asset: {e}");
return None;
}
};
let changed_file = fs::canonicalize(changed_file)
.inspect_err(|e| tracing::debug!("Failed to canonicalize hotreloaded asset: {e}"))
.ok()?;

// The asset might've been renamed thanks to the manifest, let's attempt to reload that too
if let Some(resource) = self.app.app.assets.assets.get(&changed_file).as_ref() {
Expand Down

0 comments on commit 30b1d03

Please sign in to comment.