Skip to content

Commit

Permalink
fix error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
pmenglund committed Nov 10, 2023
1 parent 02f0905 commit 144dded
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func newIngestCmd() *cobra.Command {
count, err := s.Stream(ctx, cmd.InOrStdin())
slog.Debug("wrote records", "count", count)
if err != nil {
slog.Error("failed to write", err)
slog.Error("failed to write", "err", err)
}
}

Expand Down
8 changes: 4 additions & 4 deletions cmd/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func interactiveQuery(ctx context.Context, in io.ReadCloser, out io.Writer, rs *
}
defer func() {
if err := rl.Close(); err != nil {
slog.Error("failed to close readline", err)
slog.Error("failed to close readline", "err", err)
}
}()

Expand Down Expand Up @@ -378,7 +378,7 @@ func interactiveQuery(ctx context.Context, in io.ReadCloser, out io.Writer, rs *
}

if err = rl.SaveHistory(sql); err != nil {
slog.Error("failed to save history", err)
slog.Error("failed to save history", "err", err)
}

executeQuery(ctx, out, rs, sql)
Expand All @@ -390,11 +390,11 @@ func interactiveQuery(ctx context.Context, in io.ReadCloser, out io.Writer, rs *
func executeQuery(ctx context.Context, out io.Writer, rs *rockset.RockClient, sql string) {
result, err := rs.Query(ctx, sql)
if err != nil {
slog.Error("query failed", err)
slog.Error("query failed", "err", err)
return
}

if err = showQueryResponse(out, result); err != nil {
slog.Error("failed to show result", err)
slog.Error("failed to show result", "err", err)
}
}

0 comments on commit 144dded

Please # to comment.