Skip to content

Commit a6d40f3

Browse files
committed
[DX] Show the ParseException message in YAML file loaders
1 parent 1626841 commit a6d40f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Mapping/Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function parseFile($path)
124124
try {
125125
$classes = $this->yamlParser->parseFile($path, Yaml::PARSE_CONSTANT);
126126
} catch (ParseException $e) {
127-
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $path), 0, $e);
127+
throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML', $path).': '.$e->getMessage(), 0, $e);
128128
} finally {
129129
restore_error_handler();
130130
}

0 commit comments

Comments
 (0)