From 1cd8b94bc60cb31c32d30aa64ec2b01586a70547 Mon Sep 17 00:00:00 2001 From: Femi Novia Lina Date: Fri, 6 Sep 2024 13:53:26 +0700 Subject: [PATCH] fix: error message --- modules/kafka/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/kafka/config.go b/modules/kafka/config.go index 5a56f1a..5e57761 100644 --- a/modules/kafka/config.go +++ b/modules/kafka/config.go @@ -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()) } } @@ -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 {