[DoctrineBundle] Enhance error reporting during mapping validation when nested exceptions occur.

This commit is contained in:
Benjamin Eberlei 2011-11-16 10:59:58 +01:00
parent 29018a0269
commit 6d7e6a87a8

View File

@ -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('');
}
}