diff --git a/core/lib/Drupal/Core/Config/FileStorage.php b/core/lib/Drupal/Core/Config/FileStorage.php index 52c9aa5..0a60fca 100644 --- a/core/lib/Drupal/Core/Config/FileStorage.php +++ b/core/lib/Drupal/Core/Config/FileStorage.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Config; use Symfony\Component\Yaml\Dumper; +use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Parser; /** @@ -83,9 +84,13 @@ public function read($name) { return FALSE; } $data = file_get_contents($this->getFilePath($name)); - // @todo Yaml throws a ParseException on invalid data. Is it expected to be - // caught or not? - $data = $this->decode($data); + try { + $data = $this->decode($data); + } + catch (ParseException $e) { + drupal_set_message($e->getMessage() . ' in file ' . $name); + } + return $data; }