]> git.giacomolli.uk - onechat/blobdiff - compactor.go
Check error handling and common Go mistakes
[onechat] / compactor.go
index e7a68664d8b138f0e3cda1dd391afccf1093845c..efb183ff583b272c49430c810cd3ca4d9ee8df3a 100644 (file)
@@ -65,7 +65,7 @@ func (c *Compactor) Summarize(ctx context.Context, task Task) (string, error) {
 
        instructions, err := c.instructions()
        if err != nil {
 
        instructions, err := c.instructions()
        if err != nil {
-               return "", fmt.Errorf("compact node (%d, %d): %w", task.Level, task.Index, err)
+               return "", err
        }
 
        var first []any
        }
 
        var first []any
@@ -109,7 +109,7 @@ func (c *Compactor) Summarize(ctx context.Context, task Task) (string, error) {
        }
 
        if len(lines) == 0 {
        }
 
        if len(lines) == 0 {
-               return "", fmt.Errorf("compact node (%d, %d): %w", task.Level, task.Index, err)
+               return "", err
        }
 
        return compactorShortest(lines), nil
        }
 
        return compactorShortest(lines), nil