Added helpful message when theme can not be found

This commit is contained in:
Andy Miller
2014-11-08 23:31:18 -07:00
parent 21b1323d29
commit 376cc0c095

View File

@@ -37,7 +37,12 @@ class Themes extends Iterator
/** @var Themes $themes */
$themes = $this->grav['themes'];
$themes->configure();
$instance = $themes->load();
try {
$instance = $themes->load();
} catch (\InvalidArgumentException $e) {
throw new \RuntimeException($this->current(). ' theme could not be found');
}
if ($instance instanceof EventSubscriberInterface) {
$events->addSubscriber($instance);