10000 [AssetMapper] Improving exception if a vendor asset's path is not mapped · symfony/symfony@8d01a61 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d01a61

Browse files
committed
[AssetMapper] Improving exception if a vendor asset's path is not mapped
1 parent 5aaa534 commit 8d01a61

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Symfony/Component/AssetMapper/ImportMap/ImportMapGenerator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ private function findEagerImports(MappedAsset $asset): array
232232
private function createMissingImportMapAssetException(ImportMapEntry $entry): \InvalidArgumentException
233233
{
234234
if ($entry->isRemotePackage()) {
235-
throw new LogicException(sprintf('The "%s" vendor asset is missing. Try running the "importmap:install" command.', $entry->importName));
235+
if (!file_exists($entry->path)) {
236+
throw new LogicException(sprintf('The "%s" vendor asset is missing. Try running the "importmap:install" command.', $entry->importName));
237+
}
238+
239+
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));
236240
}
237241

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

0 commit comments

Comments
 (0)
0