[DoctrineBundle] Enhance error reporting during mapping validation when nested exceptions occur.
This commit is contained in:
parent
29018a0269
commit
6d7e6a87a8
@ -71,8 +71,14 @@ EOT
|
||||
$cm = $entityManager->getClassMetadata($entityClassName);
|
||||
$output->writeln(sprintf("<info>[OK]</info> %s", $entityClassName));
|
||||
} catch (MappingException $e) {
|
||||
$message = $e->getMessage();
|
||||
while ($e->getPrevious()) {
|
||||
$e = $e->getPrevious();
|
||||
$message .= "\n" . $e->getMessage();
|
||||
}
|
||||
|
||||
$output->writeln("<error>[FAIL]</error> ".$entityClassName);
|
||||
$output->writeln(sprintf("<comment>%s</comment>", $e->getMessage()));
|
||||
$output->writeln(sprintf("<comment>%s</comment>", $message));
|
||||
$output->writeln('');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user