code: func waitForReplicationErrResponse(f raft.ApplyFuture) error {
  	err := f.Error()
  	if err == nil {
  		resp := f.Response()
  		// We call this function when we know that FutureApply's
  		// Response is an error object.
  		if resp != nil {
  			err = f.Response().(error)
  		}
  	}
  	return err
  }
docs: // When calling ApplyFuture.Error(), if we get an error it means
  // that raft failed to commit to its log.
  // But if we also want the result of FSM.Apply(), which in this
  // case is StanServer.Apply(), we need to check the Response().
  // So we first check error from future.Error(). If nil, then we
  // check the Response.