Skip to content

Commit d5348d7

Browse files
authored
NeonAdapter: throw more meaningful error which contains the filename
1 parent d1452fb commit d5348d7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/DependencyInjection/NeonAdapter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ class NeonAdapter implements Adapter
2828
public function load(string $file): array
2929
{
3030
$contents = FileReader::read($file);
31-
32-
return $this->process((array) Neon::decode($contents), '', $file);
31+
try {
32+
return $this->process((array) Neon::decode($contents), '', $file);
33+
} catch (\Nette\Neon\Exception $e) {
34+
throw new \Nette\Neon\Exception(sprintf('Error while loading %s: %s', $file, $e->getMessage()));
35+
}
3336
}
3437

3538
/**

0 commit comments

Comments
 (0)