8000 [AssetMapper] Improving exception if a vendor asset's path is not mapped by weaverryan · Pull Request #52521 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[AssetMapper] Improving exception if a vendor asset's path is not mapped #52521

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ private function findEagerImports(MappedAsset $asset): array
private function createMissingImportMapAssetException(ImportMapEntry $entry): \InvalidArgumentException
{
if ($entry->isRemotePackage()) {
throw new LogicException(sprintf('The "%s" vendor asset is missing. Try running the "importmap:install" command.', $entry->importName));
if (!is_file($entry->path)) {
throw new LogicException(sprintf('The "%s" vendor asset is missing. Try running the "importmap:install" command.', $entry->importName));
}

throw new LogicException(sprintf('The "%s" vendor file exists locally (%s), but cannot be found in any asset map paths. Be sure the assets vendor directory is an asset mapper path.', $entry->importName, $entry->path));
}

throw new LogicException(sprintf('The asset "%s" cannot be found in any asset map paths.', $entry->path));
Expand Down
0