docstr: Check if the response contains an error.
docstr_tok: ["Check","if","the","response","contains","an","error","."]
code: def _check_for_errors(self, response):
      """
      Check if the response contains an error.
      """
      if isinstance(response[0], ResponseError):
          error = response[0]
          if str(error) == "version mismatch":
              version = response[1]
              error = VersionMismatchException(version)
          raise error
  
      # If we encountered a run-time error, the last response
      # element will be an exception
      if isinstance(response[-1], ResponseError):
          raise response[-1]
  
imports: import sys
  from collections import OrderedDict
  import setuptools
  from distutils.util import strtobool
  from redis import ResponseError
  from .edge import Edge
  from .exceptions import VersionMismatchException
  from .node import Node
  from .path import Path
label_desc: Use image node_id 2 for calling the QueryResult obj's underlying member method code with example usage: obj._check_for_errors(response) without return types