code: func extractChaincodeErrorFromResponse(resp *pb.ProposalResponse) error {
  	if resp.Response.Status < int32(common.Status_SUCCESS) || resp.Response.Status >= int32(common.Status_BAD_REQUEST) {
  		details := []interface{}{resp.Endorsement, resp.Response.Payload}
  		if strings.Contains(resp.Response.Message, "premature execution") {
  			return status.New(status.EndorserClientStatus, int32(status.PrematureChaincodeExecution), resp.Response.Message, details)
  		} else if strings.Contains(resp.Response.Message, "chaincode is already launching") {
  			return status.New(status.EndorserClientStatus, int32(status.ChaincodeAlreadyLaunching), resp.Response.Message, details)
  		} else if strings.Contains(resp.Response.Message, "could not find chaincode with name") {
  			return status.New(status.EndorserClientStatus, int32(status.ChaincodeNameNotFound), resp.Response.Message, details)
  		} else if strings.Contains(resp.Response.Message, "cannot get package for chaincode") {
  			return status.New(status.EndorserClientStatus, int32(status.ChaincodeNameNotFound), resp.Response.Message, details)
  		}
  		return status.New(status.ChaincodeStatus, resp.Response.Status, resp.Response.Message, details)
  	}
  	return nil
  }
docs: //extractChaincodeErrorFromResponse extracts chaincode error from proposal response