summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrban Müller2018-10-30 14:29:22 +0100
committerUrban Müller2018-10-30 14:29:22 +0100
commita4806909cb26f951daf8c4b4a285691eecc0cf59 (patch)
treebb9791226640a338842ab1c4dee017b0e0df9b3c
parent95a5aa61f38487d11a089ae2e9cadb5240201685 (diff)
downloaditools-a4806909cb26f951daf8c4b4a285691eecc0cf59.tar.gz
itools-a4806909cb26f951daf8c4b4a285691eecc0cf59.tar.bz2
itools-a4806909cb26f951daf8c4b4a285691eecc0cf59.zip
allow sporadic error suppression
-rw-r--r--it.class4
1 files changed, 2 insertions, 2 deletions
diff --git a/it.class b/it.class
index f9c5846..aaca191 100644
--- a/it.class
+++ b/it.class
@@ -1139,9 +1139,9 @@ static function json_encode($data)
/**
* Decodes json data and provides warning if failed
*/
-static function json_decode($json)
+static function json_decode($json, $p = [])
{
- return ($data = json_decode($json)) === null && $json != 'null' ? it::error(array('title' => "invalid json", 'body' => $json)) : $data;
+ return ($data = json_decode($json)) === null && $json != 'null' ? it::error((array)$p['it_error'] + ['title' => "invalid json", 'body' => $json]) : $data;
}
/**