8000 [AssetMapper] Improve the error message when a downloaded file is mis… · symfony/symfony@06fb6fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 06fb6fe

Browse files
jmschenicolas-grekas
authored andcommitted
[AssetMapper] Improve the error message when a downloaded file is missing
1 parent 8a93c4c commit 06fb6fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ private function convertEntriesToImports(array $entries): array
382382

383383
if (null !== $entryOptions->path) {
384384
if (!$asset = $this->assetMapper->getAsset($entryOptions->path)) {
385+
if ($entryOptions->isDownloaded) {
386+
throw new \InvalidArgumentException(sprintf('The "%s" downloaded asset is missing. Run "php bin/console importmap:require "%s" --download".', $entryOptions->path, $entryOptions->importName));
387+
}
388+
385389
throw new \InvalidArgumentException(sprintf('The asset "%s" mentioned in "%s" cannot be found in any asset map paths.', $entryOptions->path, basename($this->importMapConfigPath)));
386390
}
387391
$path = $asset->publicPath;

0 commit comments

Comments
 (0)
0