Skip to content

Commit

Permalink
Handle errors with no message
Browse files Browse the repository at this point in the history
  • Loading branch information
agriffaut committed Apr 19, 2020
1 parent 1c3eb66 commit fb37eaf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions admin.go
Expand Up @@ -640,6 +640,9 @@ func (ca *clusterAdmin) DescribeConfig(resource ConfigResource) ([]ConfigEntry,
if rspResource.ErrorMsg != "" {
return nil, errors.New(rspResource.ErrorMsg)
}
if rspResource.ErrorCode != 0 {
return nil, KError(rspResource.ErrorCode)
}
for _, cfgEntry := range rspResource.Configs {
entries = append(entries, *cfgEntry)
}
Expand Down Expand Up @@ -688,6 +691,9 @@ func (ca *clusterAdmin) AlterConfig(resourceType ConfigResourceType, name string
if rspResource.ErrorMsg != "" {
return errors.New(rspResource.ErrorMsg)
}
if rspResource.ErrorCode != 0 {
return KError(rspResource.ErrorCode)
}
}
}
return nil
Expand Down

0 comments on commit fb37eaf

Please sign in to comment.