code: private void handleResponse(HandshakerResp resp) throws GeneralSecurityException {
      status = resp.getStatus();
      if (resp.hasResult()) {
        result = resp.getResult();
        close();
      }
      if (status.getCode() != Status.Code.OK.value()) {
        String error = "Handshaker service error: " + status.getDetails();
        logger.log(Level.INFO, error);
        close();
        throw new GeneralSecurityException(error);
      }
    }
docs: Parses a handshake response, setting the status, result, and closing the handshaker, as needed.