Skip to content

Commit

Permalink
feat: log rdf properties export errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wazelin committed Aug 11, 2021
1 parent 4ea934e commit 281c636
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions core/kernel/impl/class.ApiModelOO.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use oat\generis\model\OntologyRdfs;
use Doctrine\DBAL\DBALException;
use oat\generis\model\data\import\RdfImporter;
use oat\oatbox\log\LoggerAwareTrait;
use oat\oatbox\service\ServiceManager;
use Zend\ServiceManager\ServiceLocatorInterface;

Expand All @@ -46,6 +47,8 @@
*/
class core_kernel_impl_ApiModelOO extends core_kernel_impl_Api implements core_kernel_api_ApiModel
{
use LoggerAwareTrait;

// --- ASSOCIATIONS ---


Expand Down Expand Up @@ -90,6 +93,8 @@ public function importXmlRdf($targetNameSpace, $fileLocation)
*/
public function getResourceDescriptionXML($uriResource)
{
$returnValue = '';

$dbWrapper = core_kernel_classes_DbWrapper::singleton();
$subject = $dbWrapper->quote($uriResource);

Expand Down Expand Up @@ -156,19 +161,17 @@ public function getResourceDescriptionXML($uriResource)
$node->appendChild($dom->createCDATASection($object));
}
$description->appendChild($node);
} catch (DOMException $de) {
//print $de;
} catch (DOMException $exception) {
$this->logCritical($exception->getMessage(), ['exception' => $exception]);
}
}
$root->appendChild($description);
$returnValue = $dom->saveXml();
} catch (DomException $e) {
print $e;
} catch (DomException $exception) {
$this->logError($exception->getMessage(), ['exception' => $exception]);
print $exception;
}




return (string) $returnValue;
}

Expand Down

0 comments on commit 281c636

Please sign in to comment.