Skip to content

Commit

Permalink
Add org name to consortium error message
Browse files Browse the repository at this point in the history
Improve troubleshooting by including org name in the error message:
"Attempted to include a member which is not in the consortium"

New message:
"Attempted to include member BadOrgName which is not in the consortium"

This will help users that have an incorrect config transaction pinpoint the reason for failure.

Signed-off-by: David Enyeart <[email protected]>
  • Loading branch information
denyeart committed Jul 6, 2020
1 parent 780a24f commit 5362a57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion orderer/common/msgprocessor/systemchannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func (dt *DefaultTemplator) NewChannelConfig(envConfigUpdate *cb.Envelope) (chan
for orgName := range configUpdate.WriteSet.Groups[channelconfig.ApplicationGroupKey].Groups {
consortiumGroup, ok := systemChannelGroup.Groups[channelconfig.ConsortiumsGroupKey].Groups[consortium.Name].Groups[orgName]
if !ok {
return nil, fmt.Errorf("Attempted to include a member which is not in the consortium")
return nil, fmt.Errorf("Attempted to include member %s which is not in the consortium", orgName)
}
applicationGroup.Groups[orgName] = proto.Clone(consortiumGroup).(*cb.ConfigGroup)
}
Expand Down
2 changes: 1 addition & 1 deletion orderer/common/msgprocessor/systemchannel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ func TestNewChannelConfig(t *testing.T) {
),
}),
},
"Attempted to include a member which is not in the consortium",
"Attempted to include member BadOrgName which is not in the consortium",
},
} {
t.Run(tc.name, func(t *testing.T) {
Expand Down

0 comments on commit 5362a57

Please sign in to comment.