From a4806909cb26f951daf8c4b4a285691eecc0cf59 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 30 Oct 2018 14:29:22 +0100 Subject: allow sporadic error suppression --- it.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it.class') 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; } /** -- cgit v1.2.3