Mercurial > hg > isophonics-drupal-site
diff core/lib/Drupal/Core/Extension/ThemeHandler.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children | af1871eacc83 |
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Extension/ThemeHandler.php Tue Jul 10 15:07:59 2018 +0100 +++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php Thu Feb 28 13:21:36 2019 +0000 @@ -3,6 +3,8 @@ namespace Drupal\Core\Extension; use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Extension\Exception\UninstalledExtensionException; +use Drupal\Core\Extension\Exception\UnknownExtensionException; use Drupal\Core\State\StateInterface; /** @@ -147,7 +149,7 @@ public function setDefault($name) { $list = $this->listInfo(); if (!isset($list[$name])) { - throw new \InvalidArgumentException("$name theme is not installed."); + throw new UninstalledExtensionException("$name theme is not installed."); } $this->configFactory->getEditable('system.theme') ->set('default', $name) @@ -437,7 +439,7 @@ public function getName($theme) { $themes = $this->listInfo(); if (!isset($themes[$theme])) { - throw new \InvalidArgumentException("Requested the name of a non-existing theme $theme"); + throw new UnknownExtensionException("Requested the name of a non-existing theme $theme"); } return $themes[$theme]->info['name']; } @@ -486,7 +488,7 @@ if (isset($themes[$name])) { return $themes[$name]; } - throw new \InvalidArgumentException(sprintf('The theme %s does not exist.', $name)); + throw new UnknownExtensionException(sprintf('The theme %s does not exist.', $name)); } /**