Skip to content

Commit

Permalink
fix: error message
Browse files Browse the repository at this point in the history
  • Loading branch information
FemiNoviaLina committed Sep 6, 2024
1 parent 75f2365 commit 1cd8b94
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/kafka/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ func readConfig(res resource.Resource, confJSON json.RawMessage, dc driverConf)
var resCfg, cfg Config

if err := json.Unmarshal(confJSON, &cfg); err != nil {
return nil, errors.ErrInvalid.WithMsgf("invalid config json").WithCausef(err.Error())
return nil, errors.ErrInvalid.WithMsgf("failed to unmarshal").WithCausef(err.Error())
}

if res.Spec.Configs != nil {
if err := json.Unmarshal(res.Spec.Configs, &resCfg); err != nil {
return nil, errors.ErrInvalid.WithMsgf("invalid config json").WithCausef(err.Error())
return nil, errors.ErrInvalid.WithMsgf("failed to unmarshal").WithCausef(err.Error())
}
}

Expand All @@ -63,7 +63,7 @@ func readConfig(res resource.Resource, confJSON json.RawMessage, dc driverConf)

newConfJSON, err := json.Marshal(cfg)
if err != nil {
return nil, errors.ErrInvalid.WithMsgf("invalid config json").WithCausef(err.Error())
return nil, errors.ErrInvalid.WithMsgf("failed to marshal").WithCausef(err.Error())
}

if err := validateConfig(newConfJSON); err != nil {
Expand Down

0 comments on commit 1cd8b94

Please sign in to comment.