code: func readStatusFailureAsError(r io.Reader, req string, messageLengthReader lengthReader) (string, error) {
  	status, err := readOctetString(req, r)
  	if err != nil {
  		return "", errors.WrapErrorf(err, errors.NetworkError, "error reading status for %s", req)
  	}
  
  	if isFailureStatus(status) {
  		msg, err := readMessage(r, messageLengthReader)
  		if err != nil {
  			return "", errors.WrapErrorf(err, errors.NetworkError,
  				"server returned error for %s, but couldn't read the error message", req)
  		}
  
  		return "", adbServerError(req, string(msg))
  	}
  
  	return status, nil
  }
docs: // Reads the status, and if failure, reads the message and returns it as an error.
  // If the status is success, doesn't read the message.
  // req is just used to populate the AdbError, and can be nil.
  // messageLengthReader is the function passed to readMessage if the status is failure.