reflectionFailure() public static method

Exception for reflection exceptions - adds the document name, because there might be long classnames that will be shortened within the stacktrace
public static reflectionFailure ( string $document, ReflectionException $previousException ) : MappingException
$document string The document's name
$previousException ReflectionException
return MappingException
 /**
  * {@inheritDoc}
  */
 protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents = array())
 {
     /** @var $class ClassMetadata */
     /** @var $parent ClassMetadata */
     if ($parent) {
         $class->setInheritanceType($parent->inheritanceType);
         $class->setDiscriminatorField($parent->discriminatorField);
         $class->setDiscriminatorMap($parent->discriminatorMap);
         $class->setIdGeneratorType($parent->generatorType);
         $this->addInheritedFields($class, $parent);
         $this->addInheritedIndexes($class, $parent);
         $class->setIdentifier($parent->identifier);
         $class->setVersioned($parent->isVersioned);
         $class->setVersionField($parent->versionField);
         $class->setLifecycleCallbacks($parent->lifecycleCallbacks);
         $class->setChangeTrackingPolicy($parent->changeTrackingPolicy);
         $class->setFile($parent->getFile());
         if ($parent->isMappedSuperclass) {
             $class->setCustomRepositoryClass($parent->customRepositoryClassName);
         }
     }
     // Invoke driver
     try {
         $this->driver->loadMetadataForClass($class->getName(), $class);
     } catch (\ReflectionException $e) {
         throw MappingException::reflectionFailure($class->getName(), $e);
     }
     $this->validateIdentifier($class);
     if ($parent && $rootEntityFound) {
         if ($parent->generatorType) {
             $class->setIdGeneratorType($parent->generatorType);
         }
         if ($parent->generatorOptions) {
             $class->setIdGeneratorOptions($parent->generatorOptions);
         }
         if ($parent->idGenerator) {
             $class->setIdGenerator($parent->idGenerator);
         }
     } else {
         $this->completeIdGeneratorMapping($class);
     }
     if ($parent && $parent->isInheritanceTypeSingleCollection()) {
         $class->setDatabase($parent->getDatabase());
         $class->setCollection($parent->getCollection());
     }
     $class->setParentClasses($nonSuperclassParents);
     if ($this->evm->hasListeners(Events::loadClassMetadata)) {
         $eventArgs = new \Doctrine\ODM\MongoDB\Event\LoadClassMetadataEventArgs($class, $this->dm);
         $this->evm->dispatchEvent(Events::loadClassMetadata, $eventArgs);
     }
 }