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

@ -89,7 +89,15 @@ class LDSignatures {
jsonld_set_document_loader('jsonld_document_loader');
return jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
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 $d;
}
static function salmon_sign($data,$channel) {