diff options
author | Urban Müller | 2018-10-30 14:29:22 +0100 |
---|---|---|
committer | Urban Müller | 2018-10-30 14:29:22 +0100 |
commit | a4806909cb26f951daf8c4b4a285691eecc0cf59 (patch) | |
tree | bb9791226640a338842ab1c4dee017b0e0df9b3c | |
parent | 95a5aa61f38487d11a089ae2e9cadb5240201685 (diff) | |
download | itools-a4806909cb26f951daf8c4b4a285691eecc0cf59.tar.gz itools-a4806909cb26f951daf8c4b4a285691eecc0cf59.tar.bz2 itools-a4806909cb26f951daf8c4b4a285691eecc0cf59.zip |
allow sporadic error suppression
-rw-r--r-- | it.class | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } /** |