Skip to content

Commit

Permalink
fix: improve debug output when trying to configure a new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Aug 15, 2024
1 parent 244fe7e commit 11b3e99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/restic/restic.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (r *Repo) Snapshots(ctx context.Context, opts ...GenericOption) ([]*Snapsho
r.pipeCmdOutputToWriter(cmd, output)

if err := cmd.Run(); err != nil {
return nil, newCmdError(ctx, cmd, err)
return nil, newCmdError(ctx, cmd, newErrorWithOutput(err, output.String()))
}

var snapshots []*Snapshot
Expand All @@ -258,7 +258,7 @@ func (r *Repo) Forget(ctx context.Context, policy *RetentionPolicy, opts ...Gene
output := bytes.NewBuffer(nil)
r.pipeCmdOutputToWriter(cmd, output)
if err := cmd.Run(); err != nil {
return nil, newCmdError(ctx, cmd, err)
return nil, newCmdError(ctx, cmd, newErrorWithOutput(err, output.String()))
}

var result []ForgetResult
Expand Down Expand Up @@ -324,7 +324,7 @@ func (r *Repo) ListDirectory(ctx context.Context, snapshot string, path string,
r.pipeCmdOutputToWriter(cmd, output)

if err := cmd.Run(); err != nil {
return nil, nil, newCmdError(ctx, cmd, err)
return nil, nil, newCmdError(ctx, cmd, newErrorWithOutput(err, output.String()))
}

snapshots, entries, err := readLs(output)
Expand Down

0 comments on commit 11b3e99

Please sign in to comment.