Skip to content
Permalink
Browse files

Throw an exception if the template file cannot be read

  • Loading branch information
suve authored and theseer committed Mar 13, 2020
1 parent c14bc03 commit 749f5a3d712e3223a175c5702e20b93bba5e6cbb
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/Application.php
@@ -61,8 +61,14 @@ public function run() {
if ($this->config->isCacheEnabled()) {
$this->factory->getCache()->persist($this->config->getCacheFile());
}

$template = @file_get_contents($this->config->getTemplate());
if ($template === false) {
throw new ApplicationException("Failed to read the template file.");
}

$builder = $this->factory->getRenderer($result);
$code = $builder->render(file_get_contents($this->config->getTemplate()));
$code = $builder->render($template);
if ($this->config->isLintMode()) {
return $this->runLint($code);
}

0 comments on commit 749f5a3

Please sign in to comment.
You can’t perform that action at this time.