server/src/app/Console/Commands/ImportCocoonRDF.php
changeset 412 c88746153ee0
parent 410 240ca282331d
child 506 8a5bb4b48b85
--- a/server/src/app/Console/Commands/ImportCocoonRDF.php	Thu Nov 10 14:07:38 2016 +0100
+++ b/server/src/app/Console/Commands/ImportCocoonRDF.php	Thu Nov 10 15:35:18 2016 +0100
@@ -169,13 +169,19 @@
                 $documentCounts['unknown'] += 1;
                 continue;
             }
-            $documentCounts['all'] += 1;
-            $documentCounts[$docType] = isset($documentCounts[$docType])?$documentCounts[$docType]+1:1;
 
             $mapperClass = ImportCocoonRDF::MAPPER_CLASS_MAP[$docType];
             $mapper = new $mapperClass($doc, $docUri);
 
-            $mapper->mapGraph();
+            try {
+                $mapper->mapGraph();
+            } catch (\Exception $e) {
+                Log::error("Error processing $identifier ($docRdfUrl) : error mapping graph : $e");
+                $documentCounts['error'] += 1;
+            }
+            $documentCounts['all'] += 1;
+            $documentCounts[$docType] = isset($documentCounts[$docType])?$documentCounts[$docType]+1:1;
+
             $mappedGraphes = $mapper->getOutputGraphes();
 
             foreach ($mapper->getOutputGraphes() as $mappedGraphKey => $mappedGraph) {