Skip to content

Commit 4b2ccb6

Browse files
committed
nit
1 parent 71cd613 commit 4b2ccb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

flow/pkg/mongo/commands.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func runCommand[T any](ctx context.Context, client *mongo.Client, command string
8484
}
8585

8686
if err := singleResult.Decode(&result); err != nil {
87-
return result, fmt.Errorf("'%s' failed: %v", command, err)
87+
return result, fmt.Errorf("'%s' decoding failed: %v", command, err)
8888
}
8989
return result, nil
9090
}
@@ -93,11 +93,11 @@ func runDatabaseCommand[T any](ctx context.Context, client *mongo.Client, databa
9393
var result T
9494
singleResult := client.Database(database).RunCommand(ctx, commandDoc)
9595
if singleResult.Err() != nil {
96-
return result, fmt.Errorf("command failed: %v", singleResult.Err())
96+
return result, fmt.Errorf("'%s' failed: %v", commandDoc.String(), singleResult.Err())
9797
}
9898

9999
if err := singleResult.Decode(&result); err != nil {
100-
return result, fmt.Errorf("command decoding failed: %v", err)
100+
return result, fmt.Errorf("'%s' decoding failed: %v", commandDoc.String(), err)
101101
}
102102
return result, nil
103103
}

0 commit comments

Comments
 (0)