handle jsonld parse errors and send them to the app log instead of the php log.

This commit is contained in:
zotlabs 2017-09-24 20:18:36 -07:00
parent b195407028
commit 06a674775e

View file

@ -88,8 +88,16 @@ class LDSignatures {
return '';
jsonld_set_document_loader('jsonld_document_loader');
try {
$d = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
}
catch (\Exception $e) {
logger('normalise error:' . print_r($e,true));
logger('normalise error: ' . print_r($data,true));
}
return jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
return $d;
}
static function salmon_sign($data,$channel) {