docs: def prepare_exception(obj, messages=None, response=None, verbs=None):
      """Prepare excetion params or only an exception message
  
      parameters:
          messages: list of strings, that will be separated by new line
          response: response from a request to SFDC REST API
          verbs: list of options about verbosity
      """
      # pylint:disable=too-many-branches
      verbs = set(verbs or [])
      known_options = ['method+url']
      if messages is None:
          messages = []
      if isinstance(messages, (text_type, str)):
          messages = [messages]
      assert isinstance(messages, list)
      assert not verbs.difference(known_options)
  
      data = None
      # a boolean from a failed response is False, though error messages in json should be decoded
      if response is not None and 'json' in response.headers.get('Content-Type', '') and response.text:
          data = json.loads(response.text)
          if data:
              data_0 = data[0]
              if 'errorCode' in data_0:
                  subreq = ''
                  if 'referenceId' in data_0:
                      subreq = " (in subrequest {!r})".format(data_0['referenceId'])
                  messages = [data_0['errorCode'] + subreq] + messages
              if data_0.get('fields'):
                  messages.append('FIELDS: {}'.format(data_0['fields']))
              if len(data) > 1:
                  messages.append('MORE_ERRORS ({})'.format(len(data)))
      if 'method+url' in verbs:
          method = response.request.method
          url = response.request.url
          if len(url) > 100:
              url = url[:100] + '...'
          data_info = ''
          if (method in ('POST', 'PATCH') and
                  (not response.request.body or 'json' not in response.request.headers['content-type'])):
              data_info = ' (without json request data)'
          messages.append('in {} "{}"{}'.format(method, url, data_info))
      separ = '\n    '
      if not PY3:
          messages = [x if isinstance(x, str) else x.encode('utf-8') for x in messages]
      messages = [x.replace('\n', separ) for x in messages]
      message = separ.join(messages)
      if obj:
          obj.data = data
          obj.response = response
          obj.verbs = verbs
      return message