diff --git a/core/lib/Drupal/Core/Config/FileStorage.php b/core/lib/Drupal/Core/Config/FileStorage.php index 2df9fbd..0a9679c 100644 --- a/core/lib/Drupal/Core/Config/FileStorage.php +++ b/core/lib/Drupal/Core/Config/FileStorage.php @@ -10,6 +10,7 @@ use Drupal\Component\Utility\String; use Symfony\Component\Yaml\Dumper; use Symfony\Component\Yaml\Exception\DumpException; +use Symfony\Component\Yaml\Exception\ParseException; use Symfony\Component\Yaml\Parser; /** @@ -85,9 +86,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; }