private static function checkJsonError() { $errnum = json_last_error(); if ($errnum != JSON_ERROR_NONE) { throw new \Exception("JSON error: {$msg}", $err); } }