code: def _check_error(response):
          
          if 'error' in response:
              raise InfluxDBError(response['error'])
          elif 'results' in response:
              for statement in response['results']:
                  if 'error' in statement:
                      msg = '{d[error]} (statement {d[statement_id]})'
                      raise InfluxDBError(msg.format(d=statement))
docs: Checks for JSON error messages and raises Python exception