Skip to content

Commit

Permalink
Maintain mapping exception data when rethrowing exception
Browse files Browse the repository at this point in the history
  • Loading branch information
craig committed Jun 9, 2012
1 parent 0120fd5 commit 97c90b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Doctrine/ODM/PHPCR/Mapping/Driver/XmlDriver.php
Expand Up @@ -54,7 +54,8 @@ public function loadMetadataForClass($className, ClassMetadata $class)
$xmlRoot = $this->getElement($className);
}
catch(\Doctrine\Common\Persistence\Mapping\MappingException $e) {
throw new MappingException($e->getMessage());
// Convert Exception type for consistency with other drivers
throw new MappingException($e->getMessage(), $e->getCode(), $e->getPrevious());
}

if (!$xmlRoot) {
Expand Down

0 comments on commit 97c90b6

Please sign in to comment.