Skip to content

Commit

Permalink
fix: improve error message when rclone config is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Feb 17, 2024
1 parent 3d192fd commit 663b430
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/restic/restic.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func (r *Repo) Backup(ctx context.Context, progressCallback func(*BackupProgress

cmd := exec.CommandContext(ctx, r.cmd, args...)
cmd.Env = append(cmd.Env, r.buildEnv()...)
cmd.StdoutPipe()
cmd.Stderr = capture
cmd.Stdout = capture

Expand Down Expand Up @@ -185,7 +186,7 @@ func (r *Repo) Snapshots(ctx context.Context, opts ...GenericOption) ([]*Snapsho

var snapshots []*Snapshot
if err := json.Unmarshal(output, &snapshots); err != nil {
return nil, newCmdError(cmd, "", fmt.Errorf("command output is not valid JSON: %w", err))
return nil, newCmdError(cmd, string(output), fmt.Errorf("command output is not valid JSON: %w", err))
}
for _, snapshot := range snapshots {
if err := snapshot.Validate(); err != nil {
Expand Down

0 comments on commit 663b430

Please sign in to comment.