mirror of
https://github.com/restic/restic.git
synced 2025-12-11 18:47:50 +00:00
use errors.Fatalf instead of custom formatting
This commit is contained in:
@@ -171,7 +171,7 @@ func (opts *GlobalOptions) PreRun(needsPassword bool) error {
|
||||
}
|
||||
pwd, err := resolvePassword(opts, "RESTIC_PASSWORD")
|
||||
if err != nil {
|
||||
return errors.Fatal(fmt.Sprintf("Resolving password failed: %v\n", err))
|
||||
return errors.Fatalf("Resolving password failed: %v", err)
|
||||
}
|
||||
opts.password = pwd
|
||||
return nil
|
||||
|
||||
@@ -87,7 +87,7 @@ func (fp *CommandReader) wait() error {
|
||||
err := fp.cmd.Wait()
|
||||
if err != nil {
|
||||
// Use a fatal error to abort the snapshot.
|
||||
return errors.Fatal(fmt.Errorf("command failed: %w", err).Error())
|
||||
return errors.Fatalf("command failed: %v", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user