def METHOD_NAME(stream):
    from robocorp_ls_core.robotframework_log import get_logger
    log = get_logger(__name__)
    try:
        while True:
            line = stream.readline()
            if not line:
                break
            sys.stderr.buffer.write(line)
    except:
        log.exception("Error reading from server api process stream.")
    finally:
        log.debug("Finished reading from server api process stream.")