def get_job_errors(job_path, opts = {})
      url     = job_url(job_path, '/live/err')
      headers = gen_headers(opts)

      attempt(opts[:attempts]) do
        method = opts[:head] ? :head : :get
        result = @client.send(method, url, nil, headers)
        raise unless result.is_a? HTTP::Message

        if result.status == 200
          raise unless result.headers['Content-Type'] ==
                       'application/x-json-stream; type=job-error'

          return true, result.headers if method == :head

          json_chunks = result.body.split("\n")
          errors = json_chunks.map { |i| JSON.parse(i) }

          return errors, result.headers
        end

        raise_error(result)
      end
    end
def get_job_errors(job_path, opts = {})
      url     = job_url(job_path, '/live/err')
      headers = gen_headers(opts)

      attempt(opts[:attempts]) do
        method = opts[:head] ? :head : :get
        result = @client.send(method, url, nil, headers)
        raise unless result.is_a? HTTP::Message

        if result.status == 200
          raise unless result.headers['Content-Type'] ==
                       'application/x-json-stream; type=job-error'

          return true, result.headers if method == :head

          json_chunks = result.body.split("\n")
          errors = json_chunks.map { |i| JSON.parse(i) }

          return errors, result.headers
        end

        raise_error(result)
      end
    end
Gets errors that occured during the execution of a job in Manta at a given
 path.

 The path must start with /<user>/jobs/<job UUID> and point at an actual job.
 :head => true can optionally be passed in to do a HEAD instead of a GET.

 Returns an array of hashes, each hash containing information about an
 error; this information is best-effort by Manta, so it may not be complete.
 Also returns received HTTP headers.

 If there was an unrecoverable error, throws an exception. On connection or
 corruption errors, more attempts will be made; the number of attempts can
 be altered by passing in :attempts.