10000 [AssetMapper] Improve the error message when a downloaded file is missing by jmsche · Pull Request #51337 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[AssetMapper] Improve the error message when a downloaded file is missing #51337

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
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
B914
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ private function convertEntriesToImports(array $entries): array

if (null !== $entryOptions->path) {
if (!$asset = $this->assetMapper->getAsset($entryOptions->path)) {
if ($entryOptions->isDownloaded) {
throw new \InvalidArgumentException(sprintf('The "%s" downloaded asset is missing. Run "php bin/console importmap:require "%s" --download".', $entryOptions->path, $entryOptions->importName));
}

throw new \InvalidArgumentException(sprintf('The asset "%s" mentioned in "%s" cannot be found in any asset map paths.', $entryOptions->path, basename($this->importMapConfigPath)));
}
$path = $asset->publicPath;
Expand Down
0