diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-07-16 23:39:27 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-16 23:39:27 -0700 |
| commit | 69553e5ba6d46ed924b0c3adc3f8d9666550999a (patch) | |
| tree | 7711c4d9fe1919d2c6eaa841779bcde6e24b0248 /weed/mq/topic/topic.go | |
| parent | a524b4f485ce5aa2f234c742bd7d1e75386f569b (diff) | |
| download | seaweedfs-69553e5ba6d46ed924b0c3adc3f8d9666550999a.tar.xz seaweedfs-69553e5ba6d46ed924b0c3adc3f8d9666550999a.zip | |
convert error fromating to %w everywhere (#6995)
Diffstat (limited to 'weed/mq/topic/topic.go')
| -rw-r--r-- | weed/mq/topic/topic.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/mq/topic/topic.go b/weed/mq/topic/topic.go index 1e42c3f4d..56b9cda5f 100644 --- a/weed/mq/topic/topic.go +++ b/weed/mq/topic/topic.go @@ -52,12 +52,12 @@ func (t Topic) ReadConfFile(client filer_pb.SeaweedFilerClient) (*mq_pb.Configur return nil, err } if err != nil { - return nil, fmt.Errorf("read topic.conf of %v: %v", t, err) + return nil, fmt.Errorf("read topic.conf of %v: %w", t, err) } // parse into filer conf object conf := &mq_pb.ConfigureTopicResponse{} if err = jsonpb.Unmarshal(data, conf); err != nil { - return nil, fmt.Errorf("unmarshal topic %v conf: %v", t, err) + return nil, fmt.Errorf("unmarshal topic %v conf: %w", t, err) } return conf, nil } @@ -75,7 +75,7 @@ func (t Topic) ReadConfFileWithMetadata(client filer_pb.SeaweedFilerClient) (*mq if errors.Is(err, filer_pb.ErrNotFound) { return nil, 0, 0, err } - return nil, 0, 0, fmt.Errorf("lookup topic.conf of %v: %v", t, err) + return nil, 0, 0, fmt.Errorf("lookup topic.conf of %v: %w", t, err) } // Get file metadata @@ -88,7 +88,7 @@ func (t Topic) ReadConfFileWithMetadata(client filer_pb.SeaweedFilerClient) (*mq // Parse the configuration conf := &mq_pb.ConfigureTopicResponse{} if err = jsonpb.Unmarshal(resp.Entry.Content, conf); err != nil { - return nil, 0, 0, fmt.Errorf("unmarshal topic %v conf: %v", t, err) + return nil, 0, 0, fmt.Errorf("unmarshal topic %v conf: %w", t, err) } return conf, createdAtNs, modifiedAtNs, nil @@ -98,7 +98,7 @@ func (t Topic) WriteConfFile(client filer_pb.SeaweedFilerClient, conf *mq_pb.Con var buf bytes.Buffer filer.ProtoToText(&buf, conf) if err := filer.SaveInsideFiler(client, t.Dir(), filer.TopicConfFile, buf.Bytes()); err != nil { - return fmt.Errorf("save topic %v conf: %v", t, err) + return fmt.Errorf("save topic %v conf: %w", t, err) } return nil } |
