forward the parse error to the calling code
This commit is contained in:
parent
e231edd5dc
commit
c5c2d31fef
|
@ -383,7 +383,7 @@ class XmlFileLoader extends FileLoader
|
|||
try {
|
||||
$dom = XmlUtils::loadFile($file, [$this, 'validateSchema']);
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
throw new InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e);
|
||||
throw new InvalidArgumentException(sprintf('Unable to parse file "%s": %s', $file, $e->getMessage()), $e->getCode(), $e);
|
||||
}
|
||||
|
||||
$this->validateExtensions($dom, $file);
|
||||
|
|
|
@ -666,7 +666,7 @@ class YamlFileLoader extends FileLoader
|
|||
try {
|
||||
$configuration = $this->yamlParser->parseFile($file, Yaml::PARSE_CONSTANT | Yaml::PARSE_CUSTOM_TAGS);
|
||||
} catch (ParseException $e) {
|
||||
throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $file), 0, $e);
|
||||
throw new InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML: %s', $file, $e->getMessage()), 0, $e);
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
|
Reference in New Issue