Skip to content

Commit

Permalink
Merge pull request #61 from rgazelot/top-level-missing
Browse files Browse the repository at this point in the history
Add a more detailed exception message when a top-level key is missing.
  • Loading branch information
stof committed Aug 20, 2014
2 parents 15b15d8 + 1363665 commit ea15f3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function processFile(array $config)
// Find the expected params
$expectedValues = $yamlParser->parse(file_get_contents($config['dist-file']));
if (!isset($expectedValues[$parameterKey])) {
throw new \InvalidArgumentException('The dist file seems invalid.');
throw new \InvalidArgumentException(sprintf('The top-level key %s is missing.', $parameterKey));
}
$expectedParams = (array) $expectedValues[$parameterKey];

Expand Down
2 changes: 1 addition & 1 deletion Tests/ProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function provideInvalidConfiguration()
array(
'file' => 'fixtures/invalid/missing_top_level.yml',
),
'The dist file seems invalid.',
'The top-level key parameters is missing.',
),
'invalid values in the existing file' => array(
array(
Expand Down

0 comments on commit ea15f3d

Please sign in to comment.