code: func (handler *Handler) handleReady(msg *pb.ChaincodeMessage, errc chan error) error {
  	switch msg.Type {
  	case pb.ChaincodeMessage_RESPONSE:
  		if err := handler.sendChannel(msg); err != nil {
  			chaincodeLogger.Errorf("[%s] error sending %s (state:%s): %s", shorttxid(msg.Txid), msg.Type, handler.state, err)
  			return err
  		}
  		chaincodeLogger.Debugf("[%s] Received %s, communicated (state:%s)", shorttxid(msg.Txid), msg.Type, handler.state)
  		return nil
  
  	case pb.ChaincodeMessage_ERROR:
  		if err := handler.sendChannel(msg); err != nil {
  			chaincodeLogger.Errorf("[%s] error sending %s (state:%s): %s", shorttxid(msg.Txid), msg.Type, handler.state, err)
  		}
  
  		chaincodeLogger.Debugf("[%s] Error Received %s, communicated (state:%s)", shorttxid(msg.Txid), msg.Type, handler.state)
  
  		//we don't return error on ERROR
  		return nil
  
  	case pb.ChaincodeMessage_INIT:
  		chaincodeLogger.Debugf("[%s] Received %s, initializing chaincode", shorttxid(msg.Txid), msg.Type)
  		// Call the chaincode's Run function to initialize
  		handler.handleInit(msg, errc)
  		return nil
  
  	case pb.ChaincodeMessage_TRANSACTION:
  		chaincodeLogger.Debugf("[%s] Received %s, invoking transaction on chaincode(state:%s)", shorttxid(msg.Txid), msg.Type, handler.state)
  		// Call the chaincode's Run function to invoke transaction
  		handler.handleTransaction(msg, errc)
  		return nil
  	}
  
  	return errors.Errorf("[%s] Chaincode handler cannot handle message (%s) with payload size (%d) while in state: %s", msg.Txid, msg.Type, len(msg.Payload), handler.state)
  }
docs: //handle ready state