From 376cc0c095387c1bd8981185477b52c2d4d26fa5 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Sat, 8 Nov 2014 23:31:18 -0700 Subject: [PATCH] Added helpful message when theme can not be found --- system/src/Grav/Common/Themes.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/Themes.php b/system/src/Grav/Common/Themes.php index eb580889c..f5648391c 100644 --- a/system/src/Grav/Common/Themes.php +++ b/system/src/Grav/Common/Themes.php @@ -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);