Skip to content

Commit

Permalink
fix: template literal syntax in error handling for asset file paths (#…
Browse files Browse the repository at this point in the history
…1267)

Summary:
This is a PR that solves [issue 1265](#1265).

This pull request corrects a syntax error in the template literal used for handling error messages regarding asset file paths within Metro. The existing implementation failed to properly format the file path in the error message. This change updates the syntax to correctly embed the file path variable into the error message.

Changelog: [Fix] Correct template literal syntax in error handling for asset file paths.

Pull Request resolved: #1267

Test Plan:
To verify the correction, I conducted the following steps:

1. Triggered the error handling code with an incorrect asset file path to ensure the error message **includes the intended file path**.
2. Reviewed the output to confirm the file path is now **correctly formatted** within the error message.

Reviewed By: huntie

Differential Revision: D56811594

Pulled By: robhogan

fbshipit-source-id: f089996659222bca3cd0896ae13292ebb4747428
  • Loading branch information
fredrikburmester authored and facebook-github-bot committed May 1, 2024
1 parent 2405f2f commit 11f2153
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/metro/src/node-haste/lib/AssetPaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function tryParse(
function parse(filePath: string, platforms: $ReadOnlySet<string>): AssetPath {
const result = tryParse(filePath, platforms);
if (result == null) {
throw new Error('invalid asset file path: `${filePath}');
throw new Error(`invalid asset file path: ${filePath}`);
}
return result;
}
Expand Down

0 comments on commit 11f2153

Please sign in to comment.