]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/transaction_handlers.go
Fix io.Reader implementations and wrap more errors
[rbdr/mobius] / hotline / transaction_handlers.go
index 2d4eabdbf1cc478d5cf23e69fa027af6125e7d2d..20b87e2118105e0cdbd977f5a0dc19eba9db6c12 100644 (file)
@@ -1763,13 +1763,13 @@ func HandleGetFileNameList(cc *ClientConn, t *Transaction) (res []Transaction, e
                nil,
        )
        if err != nil {
-               return res, err
+               return res, fmt.Errorf("error reading file path: %w", err)
        }
 
        var fp FilePath
        if t.GetField(FieldFilePath).Data != nil {
                if _, err = fp.Write(t.GetField(FieldFilePath).Data); err != nil {
-                       return res, err
+                       return res, fmt.Errorf("error writing file path: %w", err)
                }
        }
 
@@ -1781,7 +1781,7 @@ func HandleGetFileNameList(cc *ClientConn, t *Transaction) (res []Transaction, e
 
        fileNames, err := getFileNameList(fullPath, cc.Server.Config.IgnoreFiles)
        if err != nil {
-               return res, err
+               return res, fmt.Errorf("getFileNameList: %w", err)
        }
 
        res = append(res, cc.NewReply(t, fileNames...))