From 06a674775e5606a98e0e7357b0c88378ca679e6d Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 24 Sep 2017 20:18:36 -0700 Subject: handle jsonld parse errors and send them to the app log instead of the php log. --- Zotlabs/Lib/LDSignatures.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Lib/LDSignatures.php b/Zotlabs/Lib/LDSignatures.php index d500799c0..6d7127cde 100644 --- a/Zotlabs/Lib/LDSignatures.php +++ b/Zotlabs/Lib/LDSignatures.php @@ -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) { -- cgit v1.2.3