# HG changeset patch # User ymh # Date 1487587426 -3600 # Node ID 4864076bf0e3925ba964b61450f6c117e6d59d38 # Parent 3143195e91b4c90fa448261030573916b9517c5c Correct error cases after code reorganization diff -r 3143195e91b4 -r 4864076bf0e3 server/src/app/Console/Commands/ImportCocoonRDF.php --- a/server/src/app/Console/Commands/ImportCocoonRDF.php Fri Feb 17 22:01:32 2017 +0100 +++ b/server/src/app/Console/Commands/ImportCocoonRDF.php Mon Feb 20 11:43:46 2017 +0100 @@ -86,7 +86,7 @@ $this->error("\nError processing $identifier ($docRdfUrl) : $docType unknown mapper"); Log::error("Error processing $identifier ($docRdfUrl) : $docType unknown mapper"); $this->documentCount['unknown'] += 1; - continue; + return ['unknown', null]; } $mapperClass = ImportCocoonRDF::MAPPER_CLASS_MAP[$docType]; @@ -97,6 +97,7 @@ } catch (\Exception $e) { Log::error("Error processing $identifier ($docRdfUrl) : error mapping graph : $e"); $this->documentCount['error'] += 1; + return ['error', null]; } $this->documentCount['all'] += 1; $this->documentCount[$docType] = isset($this->documentCount[$docType])?$this->documentCount[$docType]+1:1; @@ -333,6 +334,11 @@ //map the doc list($docType, $mappedGraphes) = $this->mapDoc($doc, $docUri); + if($docType === 'unknown' || $docType === 'error') { + // The error has been traced in mapDoc + continue; + } + //merge the result docs $this->mergeDocs($docType, $mappedGraphes);