def res_json(res, jsontype='JSON', exception=PluginError):
 try:
  jsondata = res.json()
 except ValueError as err:
  if (len(res.text) > 35):
   snippet = (res.text[:35] + '...')
  else:
   snippet = res.text
  raise exception('Unable to parse {0}: {1} ({2})'.format(jsontype, err, snippet))
 return jsondata

def res_json ( res , jsontype = 'JSON' , exception = PluginError ) : try : jsondata = res . json ( ) except ValueError as err : if ( len ( res . text ) > 35 ) : snippet = ( res . text [ : 35 ] + '...' ) else : snippet = res . text raise exception ( 'Unable to parse {0}: {1} ({2})' . format ( jsontype , err , snippet ) ) return jsondata
this function is deprecated .