Skip to content
Snippets Groups Projects
Unverified Commit 52d397ae authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #18830 from adixon/asset-building-error-2137

put asset rendering call into a try/catch - dev/core #2137
parents 338ca6e9 f555d59e
Branches
Tags
No related merge requests found
......@@ -188,10 +188,15 @@ class AssetBuilder {
if (!file_exists($this->getCachePath())) {
mkdir($this->getCachePath());
}
$rendered = $this->render($name, $params);
file_put_contents($this->getCachePath($fileName), $rendered['content']);
return $fileName;
try {
$rendered = $this->render($name, $params);
file_put_contents($this->getCachePath($fileName), $rendered['content']);
return $fileName;
}
catch (UnknownAssetException $e) {
// unexpected error, log and continue
Civi::log()->error('Unexpected error while rendering a file in the AssetBuilder');
}
}
return $fileName;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment